Building Netbeans web project fails on CopyLibs

626 views
Skip to first unread message

Grover Blue

unread,
Jul 20, 2011, 12:48:02 PM7/20/11
to jenkins...@googlegroups.com
I'm new to Jenkins, and I'm trying to get a Netbeans created web project to build.  Here is what I did:

First, I set up all the libraries the project uses under Global Properties Environment Variables:

LIB_RICHFACES_CLASSPATH
/var/lib/jenkins/lib/Hudson/libs.Richfaces.classpath/darkX-3.3.3.Final.jar;<a bunch of other jars>

LIB_XSTREAM_1_3_CLASSPATH
/var/lib/jenkins/lib/Hudson/libs.xstream-1.3.classpath/cglib-nodep-2.1_3.jar;<a bunch of other jars>

LIB_APACHE_COMMONS_CLASSPATH
/var/lib/jenkins/lib/Hudson/libs.ApacheCommons.classpath/commons-beanutils-1.7.0.jar;<a bunch of other jars>

LIB_ITEXT_CLASSPATH
/var/lib/jenkins/lib/Hudson/libs.iText.classpath/iText-2.1.3.jar;<a bunch of other jars>

LIB_EL_CLASSPATH
/var/lib/jenkins/lib/Hudson/libs.EL.classpath/el-impl-2.2.0-SNAPSHOT.jar

LIB_JAVA_MAIL_CLASSPATH
/var/lib/jenkins/lib/Hudson/libs.JavaMail.classpath/dsn.jar;<a bunch of other jars>


Then, in the Job I configured the Ant properties like such (the reference.* items where copied from other Jobs using the artifact copy plugin):
no.dependencies=true
reference.MyLib2.jar=lib/MyLib2.jar
reference.BaseLib.jar=lib/BaseLib.jar
libs.Richfaces.classpath=$LIB_RICHFACES_CLASSPATH
libs.xstream-1.3.classpath=$LIB_XSTREAM_1_3_CLASSPATH
libs.iText.classpath=$LIB_ITEXT_CLASSPATH
libs.ApacheCommons.classpath=$LIB_APACHE_COMMONS_CLASSPATH
libs.EL.classpath=$LIB_EL_CLASSPATH
libs.JavaMail.classpath=LIB_JAVA_MAIL_CLASSPATH


Running the build for this Job fails with the following:
BUILD FAILED
/var/lib/jenkins/home/jobs/MyWebProject/workspace/nbproject/build-impl.xml:460: The libs.CopyLibs.classpath property is not set up.
This property must point to 
org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
of NetBeans IDE installation and is usually located at 
<netbeans_installation>/java<version>/ant/extra folder.
Either open the project in the IDE and make sure CopyLibs library
exists or setup the property manually. For example like this:
 ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar

First, has anyone gotten Netbeans web projects to build with Jenkins?  Do I have to copy IDE libraries to the Jenkins machine and configure a classpath variable like above?  There has to be a better way.

Second, I'm sure I should be using something like Ivy to resolve the library dependencies.  Does anyone link to an article on how to actually do this?  I don't know much about Ivy, Maven, etc.  Right not I register all libraries manually.

Thanks!





Mustafa Suha Botsali

unread,
Jul 20, 2011, 2:49:17 PM7/20/11
to jenkins...@googlegroups.com
Hello as far as I know,

Netbeans is supporting maven style projects. You may convert your code to maven style project by copy pasting and adding libraries. (I think it is easier instead of using ant)

Also there is support for ant. Netbeans is using ant-build.xml (file name may be wrong) . If the project and the jenkins are not on the same machine you should install the server that you use in netbeans glassfish/tomcat etc. and you should give server libraries path to ant as a parameter.

Suha

Grover Blue

unread,
Jul 20, 2011, 3:54:20 PM7/20/11
to jenkins...@googlegroups.com
Thanks for your response.  I solved the problem by adding an ant property overriding j2ee.server.home.

j2ee.server.home=/opt/glassfish3/glassfish

I simply downloaded the Glassfish v3.1 zip and unpacked it to /opt/glassfish3.  The build of the project works.  I still have to test the deployment.

Thank you.
Reply all
Reply to author
Forward
0 new messages