简体   繁体   中英

Ant Java task for Java 1.6

Our project uses ant tool to build maven project. We are using java 1.6 and 1.8 for different OS related release. The build works fine for java 1.8 and same is failing when using 1.6 because of versions-maven-plugin which maven downloading is latest and compiled in 1.7.

I tried copying org.codehaus.mojo version plugin of 2.4 in local repository but still maven looking to latest 2.7 version. Is there is way to specify version in ant java task <java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}" resultproperty="@{resultproperty}" failonerror="true">

You can specify the version of versions-maven-plugin in a pluginManagement section, something like:

<pluginManagement>
  <plugins>
    <plugin>
      <artifactId>versions-maven-plugin</artifactId>
      <version>2.4</version>
    </plugin>       
  </plugins>
</pluginManagement>

Refer to: Maven2: How to be sure Maven build is using a specific plugin version?

Here is the Maven documentation: https://maven.apache.org/pom.html#plugin-management

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM