Hi,

I'm tired of the maven surefire plugin games .

Anyway, I find a way to work around the issue. Basically, I add a maven-dependency-plugin to copy the jar into target/dependency and configure the surefire to use the relative file which doesn't have space characters.

I'll commit it now.

Thanks,
Ramond


From: Mark Combellack
Sent: Tuesday, August 12, 2008 2:02 AM
To: 'Raymond Feng' ; [email protected]
Subject: RE: Problems building tracing-aspectj module on Linux and the Continuum server - solution is to upgrade the version of surefire we use.


Hi Raymond,

I've just updated to get revision 684808 and this fixes my problems on Linux. The only problem now is that it breaks the build on my Windows box. See [1] below.


Before running the build, I cleared all surefire artefacts out of my Maven repository so I could see what it is downloading. The interesting thing is that it is downloading version 2.4.3 (the latest) and an older version 2.3.1. This might be because we have hard coded version 2.3.1 in the top level pom.xml


The output shows that the build is failing because the path to my Maven repository is in C:\Documents and Settings\mcombellack\.m2\repository contains a space character.


As you asked, my Linux build environment is:
RedHat Enterprise version 5
SUN JDK 1.5.0_16
Maven 2.0.8

My Windows build environment is:
Windows XP
SUN JDK 1.5.0_16
Maven 2.0.8

Thanks,

Mark




[1] Build output on Windows

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tuscany AOP-based Logging and Tracing
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from apache [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from apache.incubator [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from codehaus-snapshot [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from central [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from apache.ws.zone [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from indiana [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from osuosl.org Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.pom 6K downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire/2.4.3/surefire-2.4.3.pom 7K downloaded Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.jar 22K downloaded
[INFO] [clean:clean]
[INFO] Deleting directory C:\dev\apache\tuscany\sca\modules\tracing-aspectj\target Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/plugins/maven-surefire-plugin/2.3.1/maven-surefire-plugin-2.3.1.pom 5K downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire/2.3.1/surefire-2.3.1.pom 5K downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/plugins/maven-surefire-plugin/2.3.1/maven-surefire-plugin-2.3.1.jar 18K downloaded [INFO] Reloading plugin container for: org.apache.maven.plugins:maven-surefire-plugin. The plugin artifact has changed.
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 3 source files to C:\dev\apache\tuscany\sca\modules\tracing-aspectj\target\classes
[INFO] [bundle:manifest {execution: bundle-manifest}]
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to C:\dev\apache\tuscany\sca\modules\tracing-aspectj\target\test-classes Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-booter/2.3.1/surefire-booter-2.3.1.pom 1K downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-api/2.3.1/surefire-api-2.3.1.pom 1012b downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-booter/2.3.1/surefire-booter-2.3.1.jar 33K downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-api/2.3.1/surefire-api-2.3.1.jar 53K downloaded
[INFO] [surefire:test]
Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-junit4/2.3.1/surefire-junit4-2.3.1.pom 1K downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-providers/2.3.1/surefire-providers-2.3.1.pom 797b downloaded Downloading: http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/maven/surefire/surefire-junit4/2.3.1/surefire-junit4-2.3.1.jar 10K downloaded [INFO] Surefire report directory: C:\dev\apache\tuscany\sca\modules\tracing-aspectj\target\surefire-reports
Error occurred during initialization of VM
Error opening zip file: C:\Documents
agent library failed to init: instrument
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to C:\dev\apache\tuscany\sca\modules\tracing-aspectj\target\surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29 seconds
[INFO] Finished at: Tue Aug 12 09:07:47 BST 2008
[INFO] Final Memory: 8M/16M
[INFO] ------------------------------------------------------------------------






From: Raymond Feng [mailto:[EMAIL PROTECTED]
Sent: 11 August 2008 17:56
To: [email protected]; [EMAIL PROTECTED]
Subject: Re: Problems building tracing-aspectj module on Linux and the Continuum server - solution is to upgrade the version of surefire we use.

It should be fixed under r684808 now. Interestingly it worked before with Windows and Red Hat Linux. What environment do you have?

Thanks,
Raymond

From: Mark Combellack
Sent: Monday, August 11, 2008 7:07 AM
To: [email protected]
Subject: Problems building tracing-aspectj module on Linux and the Continuum server - solution is to upgrade the version of surefire we use.

Hi,

I am currently getting build failures with the tracing-aspectj project when building on Linux. The Continuum server [1] is also seeing the same issue.

See [3] for the full build output from the Continuum server for the tracing-aspectj project. The key bit from the output is:

[INFO] [surefire:test]
[INFO] Surefire report directory: /home/continuum/data/working-directory/277/modules/tracing-aspectj/target/surefire-reports
Error occurred during initialization of VM
Error opening zip file: "/home/continuum/.m2/repository/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar"
agent library failed to init: instrument


The problem is that the build is attempting to run surefire with the AspectJ codeweaver as the javaagent but is passing in an invalid filename. The code that is causing this issue is in the pom.xml.


               <configuration>
                   <includes>
                       <include>**/*TestCase.java</include>
                   </includes>
                   <reportFormat>brief</reportFormat>
                   <useFile>false</useFile>
                   <forkMode>once</forkMode>
                       <!--  I hit a bug in maven-surefire-plugin
                       http://jira.codehaus.org/browse/SUREFIRE-128 -->
                   <argLine>-ea -Xmx128m 
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar"</argLine>
               </configuration>

In the pom.xml file, the path to the aspectjweaver jar is surrounded by " so that it will handle paths with spaces in it. As the comment says, this was added as a work around to fix surefire bug 128 [2] This surefire bug has now been fixed in versions 2.4 and above.

The problem we have is that we are still using a version 2.3.1 which does not contain the fix for this bug.



What I would like to do is:
· Upgrade the version of surefire that we are using to the latest version - version 2.4.3 · Remove the " from the pom.xml of the tracing-aspectj project to fix the build on Linux and the Continuum server.


Anyone have any reservations about upgrading to the latest version of surefire?

Thanks,

Mark




[1] http://vmbuild.apache.org/continuum/buildResult.action?buildId=107618&projectId=277&projectGroupId=19
[2] http://jira.codehaus.org/browse/SUREFIRE-128
[3] Full build output below for the tracing-aspectj project

[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tuscany AOP-based Logging and Tracing
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from apache [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from apache.incubator [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from codehaus-snapshot [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from apache.ws.zone [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from indiana [INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from osuosl.org
[INFO] [clean:clean]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
Downloading: http://people.apache.org/repo/m2-incubating-repository/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.pom Downloading: http://ws.zones.apache.org/repository2/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.pom Downloading: http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2//org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.pom Downloading: http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.pom Downloading: http://repo1.maven.org/maven2/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.pom
494b downloaded
Downloading: http://people.apache.org/repo/m2-incubating-repository/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.pom Downloading: http://ws.zones.apache.org/repository2/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.pom Downloading: http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2//org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.pom Downloading: http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.pom Downloading: http://repo1.maven.org/maven2/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.pom
495b downloaded
Downloading: http://people.apache.org/repo/m2-incubating-repository/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.pom Downloading: http://ws.zones.apache.org/repository2/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.pom Downloading: http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2//org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.pom Downloading: http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.pom Downloading: http://repo1.maven.org/maven2/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.pom
497b downloaded
Downloading: http://people.apache.org/repo/m2-incubating-repository/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.jar Downloading: http://ws.zones.apache.org/repository2/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.jar Downloading: http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2//org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.jar Downloading: http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.jar Downloading: http://repo1.maven.org/maven2/org/aspectj/aspectjrt/1.6.1/aspectjrt-1.6.1.jar
112K downloaded
Downloading: http://people.apache.org/repo/m2-incubating-repository/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.jar Downloading: http://ws.zones.apache.org/repository2/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.jar Downloading: http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2//org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.jar Downloading: http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.jar Downloading: http://repo1.maven.org/maven2/org/aspectj/aspectjlib/1.6.1/aspectjlib-1.6.1.jar
7K downloaded
[INFO] [compiler:compile]
[INFO] Compiling 3 source files to /home/continuum/data/working-directory/277/modules/tracing-aspectj/target/classes
[INFO] [bundle:manifest {execution: bundle-manifest}]
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
Downloading: http://people.apache.org/repo/m2-incubating-repository/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar Downloading: http://ws.zones.apache.org/repository2/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar Downloading: http://ftp.ussg.iu.edu/eclipse/modeling/emf/emf/maven2//org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar Downloading: http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar Downloading: http://repo1.maven.org/maven2/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar
1530K downloaded
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to /home/continuum/data/working-directory/277/modules/tracing-aspectj/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/continuum/data/working-directory/277/modules/tracing-aspectj/target/surefire-reports
Error occurred during initialization of VM
Error opening zip file: "/home/continuum/.m2/repository/org/aspectj/aspectjweaver/1.6.1/aspectjweaver-1.6.1.jar"
agent library failed to init: instrument


Reply via email to