The Answer to Life, the Universe, and Everything

Sunday, December 09, 2007

Maven2 deploy to other server

Create file settings.xml under .m2
<?xml version='1.0' encoding='utf-8' ?>
<settings>
<servers>
<server>
<id>scp-repository</id>
<username>cavalier</username>
<privateKey>C:\Program Files\PuTTY\auth\id_rsa</privateKey>
<passphrase>xxxxxx</passphrase>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</server>
</servers>
</settings>


Then add the following to pom.xml
<distributionManagement>
<repository>
<id>scp-repository</id>
<url>scp://192.168.0.xx/home/cav/repository</url>
</repository>
</distributionManagement>

maven2 java version

You might need to specify the compile java version by using generics etc in pom.xml file.

<project>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>

Saturday, December 01, 2007

Eclipse3.3.1 OutOfMemory

Eclipse 3.3.1 has bug on memory part.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=92250

Edit the "eclipse.ini" to fix the issue.
-showsplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx768m
-XX:MaxPermSize=256m

Maven + Eclipse = Error?

If you face the something like the following error,
Unbound classpath variable: ‘M2_REPO/bouncycastle/bcmail-jdk14/132/bcmail-jdk14-132.jar



Select the Eclipse Project folder from the Navigator window view
Right Click and get the Project Properties.
Select the tree item named “Java Build Path”
Push the button on the Right that says Add Variables.
Then Push the button that says Configure Variables.
Then push the New button
Add a new variable named M2_REPO and map it to the directory that contains the repository above.
Exit back to the “New Variable Classpath entry” dialog.
Select the M2_REPO variable and click extend
Select a jar file and exit.

Maven2 : Adding jar to local repos

This is how you can add the Non globally installed jar to your local repos.
mvn install:install-file -DgroupId=<<$Group Name>> -DartifactId=<<$Project Name>> \
-Dversion=<<$S/W version>> -Dpackaging=jar -Dfile=<<$Path to the jar file>>