With use of versions maven plugin, you can easily change all POM files instantly from a project by using cmd line:
mvn versions:set -DnewVersion=1.0.1
This will change temporarly the version of POM files until you commit this modification by :
mvn versions:commit
or rollback to the previous version:
mvn versions:rollback
Kind of Java
jeudi 23 juin 2011
Java classpath via Maven too long (Windows)
If you have any problems with Java Classpath length :
For example:
[ERROR]Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:exec (default-cli) on project gcl-presentation: Result of cmd.exe /X /C ""C:\Program Files\Java\jdk1.6.0_24\bin\java.exe" [...] execution is: '1'. -> [Help 1] [ERROR] [ERROR]To see the full stack trace of the errors, re-run Maven with the -e switch.
The problem is that the Java Classpath is contained in the command line instead of putting it into $CLASSPATH env. variable. The workaround consist on asking Maven to do it by writing classpath directly in a manifest file.This solution can be applied on 2 context, depending on the maven plugin you use.
Solution for maven-jar-plugin
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
...
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
...
</plugin>
</plugins>
</build>
...
</project>
Solution for exec-maven-plugin
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
...
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>maven</executable>
<!-- optional -->
<workingDirectory>/tmp</workingDirectory>
<longClassPath>true</longClasspath>
<arguments>
...
</arguments>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
on Netbeans :
Inscription à :
Articles (Atom)