Pages

Sunday, July 21, 2013

How to install a custom maven dependency to your local repository

This is very easy to do. Open a terminal and enter the following command.

mvn install:install-file -Dfile=c:\customBuiltjar-{version}.jar -DgroupId=your.jar.groupid  -DartifactId=customBuiltjar -Dversion={version} -Dpackaging=jar

Here the -Dfile parameter indicates the path to jar file. Also replace the -DgroupId with your group id for the dependency.

Thursday, July 4, 2013

maven compile error -maven compile annotations are not supported in source 1.3

This error occurs because maven by default uses jdk 1.3 for compiling. As you know java 1.3 does not support annotations. So in order to avoid this error you need to use a newer version of java. Maven provides a plugin to compile your code to a specific java version. Add the following in your pom.xml source code. Then it should do the trick.


                  <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>