|
Marc Prud'hommeaux made changes - 28/Mar/07 09:00 AM
What?! Please appologize my lack of understanding, but comments like this "Try building another maven project and see if the same problem occurs. I recommend re-installing maven." doesn't apply in this scenario. I'm building Apache Geronimo and Apache OpenEJB almost every day with success (they're built with M2) and there are other M2-ized projects that work fine (with OpenJPA as a dependency, too) and I can't understand why re-installing M2 would help here if everything but OpenJPA builds fine?
Please have a look at the attachment with the output of executing 'mvn -e -X clean install' command. The attachment contains all that's necessary to back up the reopening.
Jacek Laskowski made changes - 28/Mar/07 11:31 AM
Jacek Laskowski made changes - 28/Mar/07 11:32 AM
Jacek,
I just reproduced your problem. It looks to be related to the surefire 2.3 plugin for maven. I first tried my current maven setup and that had surefire 2.0. Everything worked just fine. I then attempted to remove just the surefire 2.0 plugin, but maven just downloaded the same 2.0 version. So, I removed maven completely from my .m2 repository and surefire 2.3 was downloaded and my build failed in the same way as yours (same exception anyway): [INFO] Surefire report directory: C:\eclipse.workspaces\3.2.2\openjpa\openjpa-lib\target\surefire-reports [INFO] Building jar: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\surefirebooter27730.jar java.net.MalformedURLException: unknown protocol: c at java.net.URL.<init>(URL.java:608) at java.net.URL.<init>(URL.java:498) at sun.misc.URLClassPath$JarLoader.parseClassPath(URLClassPath.java:1118) at sun.misc.URLClassPath$JarLoader.getClassPath(URLClassPath.java:1091) at sun.misc.URLClassPath.getLoader(URLClassPath.java:476) at sun.misc.URLClassPath.getResource(URLClassPath.java:322) at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:959) at java.security.AccessController.doPrivileged(AccessController.java:275) at java.net.URLClassLoader.findClass(URLClassLoader.java:487) at java.lang.ClassLoader.loadClass(ClassLoader.java:602) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327) at java.lang.ClassLoader.loadClass(ClassLoader.java:568) The java class is not found: org.apache.maven.surefire.booter.SurefireBooter If I modify my pom.xml to use surefire 2.2, everything builds again... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.2</version> : Not sure what is wrong with surefire 2.3, but we have experienced a few problems with it. Maybe we should update our pom.xml to use version 2.2 until it gets more stable. Kevin
I haven't had any problems with surefire 2.3, but I don't build on Windows. I think setting the surefire version to 2.2 in the pom.xml is a fine solution ... I've gone ahead and committed this change. Please comment in this issue if the problem still occurs.
Marc Prud'hommeaux made changes - 28/Mar/07 04:28 PM
Alas, the build went further, but still fails. See the attached output of 'mvn clean install' command.
Jacek Laskowski made changes - 28/Mar/07 06:03 PM
Jacek Laskowski made changes - 28/Mar/07 06:04 PM
If you manually include the tools.jar (in your Java system library directory) in your CLASSPATH, do you still get the same error? Can you post the setting of your CLASSPATH?
It's something pertaining to the way Ant is executed from within M2, and OpenJPA build runs into troubles. I could reproduce it with a simple, almost empty project. When build.xml is executed directly with ant it runs fine. When it's executed from M2 it fails with the following error message. Any hints on how to work it out?
jlaskowski@dev /cygdrive/c/ $ ant -version Apache Ant version 1.7.0 compiled on December 13 2006 jlaskowski@dev /cygdrive/c/ $ mvn -v Maven version: 2.0.5 jlaskowski@dev /cygdrive/c/ $ echo $CLASSPATH jlaskowski@dev /cygdrive/c/ $ echo $JAVA_HOME /cygdrive/c/apps/java5 jlaskowski@dev /cygdrive/c/ $ java -version java version "1.5.0_11" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03) Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode) jlaskowski@dev /cygdrive/c/ $ ant Buildfile: build.xml compile: [javac] Compiling 1 source file BUILD SUCCESSFUL Total time: 0 seconds jlaskowski@dev /cygdrive/c/ $ mvn integration-test [INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building OpenJPA Examples Integration Tests [INFO] task-segment: [integration-test] [INFO] ---------------------------------------------------------------------------- [INFO] [site:attach-descriptor] [INFO] [antrun:run {execution: run-examples}] [INFO] Executing tasks [echo] Running OpenJPA Examples compile: [javac] Compiling 1 source file [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing ant tasks Embedded error: The following error occurred while executing this line: C:\ com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO] Finished at: Wed Mar 28 21:36:02 CEST 2007 [INFO] Final Memory: 4M/254M [INFO] ------------------------------------------------------------------------ $ cat pom.xml <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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>xxx</groupId> <artifactId>examples</artifactId> <packaging>pom</packaging> <version>1.0</version> <name>OpenJPA Examples Integration Tests</name> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>run-examples</id> <phase>integration-test</phase> <configuration> <tasks> <echo>Running OpenJPA Examples</echo> <subant inheritAll="false"> <fileset dir="." includes="build.xml"/> </subant> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project> jlaskowski@dev /cygdrive/c/ $ cat build.xml <project default="compile"> <target name="compile" description="Compile the example java files"> <javac srcdir="src" /> </target> </project> Applying the patch lets you go on with the build until another BUILD ERROR:
[INFO] ---------------------------------------------------------------------------- [INFO] Building OpenJPA JPA TCK Integration Tests [INFO] task-segment: [clean, install] [INFO] ---------------------------------------------------------------------------- [INFO] [clean:clean] [INFO] Deleting directory c:\oss\openjpa\openjpa-integration\tck\target [INFO] Deleting directory c:\oss\openjpa\openjpa-integration\tck\target\classes [INFO] Deleting directory c:\oss\openjpa\openjpa-integration\tck\target\test-classes [INFO] [site:attach-descriptor] [INFO] [antrun:run {execution: run-tck}] [INFO] Executing tasks [echo] Running Sun JPA TCK [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing ant tasks Embedded error: The TCK file C:\.m2/../privaterepos/jpa-1_0a-tck.zip does not exist. This file must be downloaded separately in order to be able to run the JPA TCK [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 minutes 33 seconds [INFO] Finished at: Wed Mar 28 21:58:01 CEST 2007 [INFO] Final Memory: 35M/254M [INFO] ------------------------------------------------------------------------ I wonder how non-committers build OpenJPA?! Could the tck modue be moved to a profile that's executed for some?
Jacek Laskowski made changes - 28/Mar/07 08:08 PM
mvn package -Dtest=false did the trick. mvn clean package works now too! mvn install fails. See the following build error (after the successful build message). It looks install isn't for faint-hearted. It should be documented somewhere on the website.
[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] OpenJPA ............................................... SUCCESS [1.328s] [INFO] OpenJPA Utilities ..................................... SUCCESS [29.250s] [INFO] OpenJPA Kernel ........................................ SUCCESS [15.453s] [INFO] OpenJPA JDBC .......................................... SUCCESS [12.203s] [INFO] OpenJPA XML Store ..................................... SUCCESS [0.407s] [INFO] OpenJPA Kernel 1.5 .................................... SUCCESS [0.312s] [INFO] OpenJPA JDBC 1.5 ...................................... SUCCESS [0.297s] [INFO] OpenJPA JPA ........................................... SUCCESS [2.015s] [INFO] OpenJPA JPA JDBC ...................................... SUCCESS [11.203s] [INFO] OpenJPA Aggregate Jar ................................. SUCCESS [20.438s] [INFO] OpenJPA Persistence Examples .......................... SUCCESS [0.562s] [INFO] OpenJPA Distribution .................................. SUCCESS [35.578s] [INFO] OpenJPA Integration Tests ............................. SUCCESS [0.000s] [INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.000s] [INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.000s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 minutes 9 seconds [INFO] Finished at: Thu Mar 29 00:07:18 CEST 2007 [INFO] Final Memory: 26M/254M [INFO] ------------------------------------------------------------------------ [echo] Running Sun JPA TCK [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing ant tasks Embedded error: The TCK file C:\.m2/../privaterepos/jpa-1_0a-tck.zip does not exist. This file must be downloaded separately in order to be able to run the JPA TCK [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 minutes 36 seconds [INFO] Finished at: Thu Mar 29 00:18:28 CEST 2007 [INFO] Final Memory: 35M/254M [INFO] ------------------------------------------------------------------------ Sorry about that -- I don't think that many of us run 'mvn install' all that often.
I just removed the line that tries to invoke the tck in r523613; hopefully, you should now be able to build successfully. I was just able to run a 'mvn clean install' without issue.
Patrick Linskey made changes - 29/Mar/07 08:34 AM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If this problem only happens with OpenJPA, please re-open this bug and post the output of the mvn command with the "-e" and "-X" flags.