Tuesday, 15 April 2014

java - Maven failing to aquire dependencies -



java - Maven failing to aquire dependencies -

so i'm still new maven don't understand how whole process works well. anyway i'm trying maven compile project, when run command "mvn compile" first gives me build failure if run command "mvn package" succeed , anyway subsequent "mvn compile"s work after that. issue need submit git sends off review jenkins, it's @ time failing , don't know how prepare it. here log

building in workspace /var/lib/jenkins/workspace/my_dropbox checkout:my_dropbox / /var/lib/jenkins/workspace/my_dropbox - hudson.remoting.localchannel@427e3f2 using strategy: gerrit trigger lastly built revision: revision 05182398b298d442d1c238673a40beb52b83386f (anything_but_blank) fetching changes 1 remote git repository fetching upstream changes ssh://jenkins@gerrit:29418/my_dropbox.git commencing build of revision 0980748fbbd29ff9acd2134dd55cb84afb577dd7 (anything_but_blank) checking out revision 0980748fbbd29ff9acd2134dd55cb84afb577dd7 (anything_but_blank) parsing poms [my_dropbox] $ /usr/lib/jvm/jdk1.7.0/bin/java -cp /var/lib/jenkins/plugins/maven-plugin/web-inf/lib/maven3-agent-1.2.jar:/var/lib/jenkins/tools/maven/maven_3/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.maven3main /var/lib/jenkins/tools/maven/maven_3 /var/cache/jenkins/war/web-inf/lib/remoting-2.19.jar /var/lib/jenkins/plugins/maven-plugin/web-inf/lib/maven3-interceptor-1.2.jar 40598 <===[jenkins remoting capacity]===>channel started log4j:warn no appenders found logger (org.apache.commons.beanutils.converters.booleanconverter). log4j:warn please initialize log4j scheme properly. executing maven: -b -f /var/lib/jenkins/workspace/my_dropbox/pom.xml clean bundle [info] scanning projects... [warning] [warning] problems encountered while building effective model simpledropbox:simpledropbox:jar:0.0.1-snapshot [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-jar-plugin missing. @ line 35, column 9 [warning] [warning] highly recommended prepare these problems because threaten stability of build. [warning] [warning] reason, future maven versions might no longer back upwards building such malformed projects. [warning] projects build: [mavenproject: simpledropbox:simpledropbox:0.0.1-snapshot @ /var/lib/jenkins/workspace/my_dropbox/pom.xml] projectstarted simpledropbox:simpledropbox:0.0.1-snapshot [info] [info] ------------------------------------------------------------------------ [info] building fiachra 0.0.1-snapshot [info] ------------------------------------------------------------------------ mojostarted org.apache.maven.plugins:maven-clean-plugin:2.4.1(default-clean) [info] [info] --- maven-clean-plugin:2.4.1:clean (default-clean) @ simpledropbox --- [info] deleting /var/lib/jenkins/workspace/my_dropbox/target mojosucceeded org.apache.maven.plugins:maven-clean-plugin:2.4.1(default-clean) mojostarted org.apache.maven.plugins:maven-resources-plugin:2.5(default-resources) [info] [info] --- maven-resources-plugin:2.5:resources (default-resources) @ simpledropbox --- [debug] execute contextualize [warning] using platform encoding (utf-8 actually) re-create filtered resources, i.e. build platform dependent! [info] skip non existing resourcedirectory /var/lib/jenkins/workspace/my_dropbox/src/main/resources mojosucceeded org.apache.maven.plugins:maven-resources-plugin:2.5(default-resources) mojostarted org.apache.maven.plugins:maven-compiler-plugin:2.3.1(default-compile) [info] [info] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ simpledropbox --- [warning] file encoding has not been set, using platform encoding utf-8, i.e. build platform dependent! [info] compiling 12 source files /var/lib/jenkins/workspace/my_dropbox/target/classes [info] ------------------------------------------------------------- mojofailed org.apache.maven.plugins:maven-compiler-plugin:2.3.1(default-compile)[error] compilation error : [info] ------------------------------------------------------------- [error] /var/lib/jenkins/workspace/my_dropbox/src/test/java/testsomething.java:[3,23] error: bundle org.junit not exist [error] /var/lib/jenkins/workspace/my_dropbox/src/test/java/testsomething.java:[7,16] error: bundle org.junit not exist [error] /var/lib/jenkins/workspace/my_dropbox/src/test/java/testsomething.java:[11,2] error: cannot find symbol [info] 3 errors [info] ------------------------------------------------------------- projectfailed simpledropbox:simpledropbox:0.0.1-snapshot sessionended [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 7.054s [info] finished at: wed feb 20 09:03:25 gmt 2013 [info] final memory: 11m/240m [info] ------------------------------------------------------------------------ projects build: [mavenproject: simpledropbox:simpledropbox:0.0.1-snapshot @ /var/lib/jenkins/workspace/my_dropbox/pom.xml] [jenkins] archiving /var/lib/jenkins/workspace/my_dropbox/pom.xml /var/lib/jenkins/jobs/my_dropbox/modules/simpledropbox$simpledropbox/builds/2013-02-20_09-03-14/archive/simpledropbox/simpledropbox/0.0.1-snapshot/simpledropbox-0.0.1-snapshot.pom waiting jenkins finish collecting info mavenexecutionresult exceptions not empty message : failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project simpledropbox: compilation failure cause : compilation failure stack trace : org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project simpledropbox: compilation failure @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:213) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:84) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:59) @ org.apache.maven.lifecycle.internal.lifecyclestarter.singlethreadedbuild(lifecyclestarter.java:183) @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:161) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:320) @ org.apache.maven.defaultmaven.execute(defaultmaven.java:156) @ org.jvnet.hudson.maven3.launcher.maven3launcher.main(maven3launcher.java:79) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:601) @ org.codehaus.plexus.classworlds.launcher.launcher.launchstandard(launcher.java:329) @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:239) @ org.jvnet.hudson.maven3.agent.maven3main.launch(maven3main.java:158) @ hudson.maven.maven3builder.call(maven3builder.java:98) @ hudson.maven.maven3builder.call(maven3builder.java:64) @ hudson.remoting.userrequest.perform(userrequest.java:118) @ hudson.remoting.userrequest.perform(userrequest.java:48) @ hudson.remoting.request$2.run(request.java:326) @ hudson.remoting.interceptingexecutorservice$1.call(interceptingexecutorservice.java:72) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1110) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:603) @ java.lang.thread.run(thread.java:722) caused by: org.apache.maven.plugin.compilationfailureexception: compilation failure @ org.apache.maven.plugin.abstractcompilermojo.execute(abstractcompilermojo.java:656) @ org.apache.maven.plugin.compilermojo.execute(compilermojo.java:128) @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:101) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:209) ... 27 more channel stopped notifying upstream projects of job completion finished: failure

and here pom file

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>simpledropbox</groupid> <artifactid>simpledropbox</artifactid> <version>0.0.1-snapshot</version> <name>fiachra</name> <description>it's simple dropbox</description> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.10</version> <scope>test</scope> </dependency> <dependency> <groupid>commons-codec</groupid> <artifactid>commons-codec</artifactid> <version>1.3</version> </dependency> </dependencies> <build> <sourcedirectory>src</sourcedirectory> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>2.3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <configuration> <archive> <manifest> <mainclass>main.java.main</mainclass> <packagename>main.java</packagename> </manifest> <manifestentries> <mode>development</mode> </manifestentries> </archive> </configuration> </plugin> </plugins> </build> </project>

here local clean install.

fiachra@fiachra-precision-workstation-t5500 my_dropbox (develop *%=) $ mvn clean [info] scanning projects... [info] ------------------------------------------------------------------------ [info] building fiachra [info] task-segment: [clean] [info] ------------------------------------------------------------------------ [info] [clean:clean {execution: default-clean}] [info] deleting file set: /home/fiachra/work/my_dropbox/target (included: [**], excluded: []) [info] ------------------------------------------------------------------------ [info] build successful [info] ------------------------------------------------------------------------ [info] total time: < 1 sec [info] finished at: wed feb 20 10:28:00 gmt 2013 [info] final memory: 11m/361m [info] ------------------------------------------------------------------------ fiachra@fiachra-precision-workstation-t5500 my_dropbox (develop *%=) $ mvn install [info] scanning projects... [info] ------------------------------------------------------------------------ [info] building fiachra [info] task-segment: [install] [info] ------------------------------------------------------------------------ [info] [resources:resources {execution: default-resources}] [warning] using platform encoding (utf-8 actually) re-create filtered resources, i.e. build platform dependent! [info] skip non existing resourcedirectory /home/fiachra/work/my_dropbox/src/main/resources [info] [compiler:compile {execution: default-compile}] [warning] file encoding has not been set, using platform encoding utf-8, i.e. build platform dependent! [info] compiling 12 source files /home/fiachra/work/my_dropbox/target/classes [info] ------------------------------------------------------------- [error] compilation error : [info] ------------------------------------------------------------- [error] /home/fiachra/work/my_dropbox/src/test/java/testsomething.java:[3,23] error: bundle org.junit not exist [error] /home/fiachra/work/my_dropbox/src/test/java/testsomething.java:[9,2] error: cannot find symbol [info] 2 errors [info] ------------------------------------------------------------- [info] ------------------------------------------------------------------------ [error] build failure [info] ------------------------------------------------------------------------ [info] compilation failure /home/fiachra/work/my_dropbox/src/test/java/testsomething.java:[3,23] error: bundle org.junit not exist /home/fiachra/work/my_dropbox/src/test/java/testsomething.java:[9,2] error: cannot find symbol [info] ------------------------------------------------------------------------ [info] more information, run maven -e switch [info] ------------------------------------------------------------------------ [info] total time: 1 sec [info] finished at: wed feb 20 10:28:06 gmt 2013 [info] final memory: 15m/361m [info] ------------------------------------------------------------------------

any help appreciated.

edit : got it.

in pom, modifiy default sourcedirectory (you should not united nations less have reason)

<sourcedirectory>src</sourcedirectory>

therefor, maven tries compile test classes during compile phase. junit not available (scope of junit dependency test).

remove

<sourcedirectory>src</sourcedirectory>

and should work

java git maven jenkins

No comments:

Post a Comment