Re: Re : Re : A classpath issue ?
Sorry for the late answer, I had not seen your question. I now saw it because the exact same issue showed up again a year later when running the build on a new computer. I had forgotten again to install this settings.xml file. So I just copied it again in the .m2/ directory and it now works fine. To be honest, I don't know today what in this file makes the issue go away. Here is the settings.xml file content: ?xml version=1.0 encoding=UTF-8? settings xmlns=http://maven.apache.org/SETTINGS/1.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd; pluginGroups pluginGrouporg.mortbay.jetty/pluginGroup /pluginGroups profiles profile activation activeByDefaulttrue/activeByDefault /activation repositories repository idmaven2/id nameMaven2 repository/name releases enabledtrue/enabled /releases snapshots enabledfalse/enabled /snapshots urlhttp://repo2.maven.org/maven2/url /repository repository idibiblio/id nameibiblio repository/name releases enabledtrue/enabled /releases snapshots enabledfalse/enabled /snapshots urlhttp://www.ibiblio.org/maven/url /repository repository idmaven/id nameMaven repository/name releases enabledtrue/enabled /releases snapshots enabledfalse/enabled /snapshots urlhttp://mvnrepository.com/url /repository /repositories /profile /profiles /settings -- View this message in context: http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p5459421.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Re : Re : A classpath issue ?
I just found out what in the settings.xml file prevents this issue. It is the directive: activation activeByDefaulttrue/activeByDefault /activation that makes the issue go away. Removing this directive from the settings.xml file triggers the exception. I wonder why.. -- View this message in context: http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p5459429.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Re : Re : A classpath issue ?
I was using the default install of maven on the iMac and I forgot to copy the settings.xml file I had on Linux. I guess I'm a little bit curious now about the contents of your settings.xml file... Must be a profile that does something with your spring xml file? Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re : Re : A classpath issue ?
Stupid me !! I was using the default install of maven on the iMac and I forgot to copy the settings.xml file I had on Linux. Funny, the default maven install on the iMac had no settings.xml file at all. Did the copy and the build passed. So sorry to bother you smart people with my mistake.. Kind Regards, Stephane De : Wayne Fay [via Maven] ml-node+3301286-284534167-63...@n5.nabble.com À : Stephane-3 mittiprove...@yahoo.se Envoyé le : Sam 11 décembre 2010, 7h 12min 46s Objet : Re: Re : A classpath issue ? And, again on the iMac, if this time I don't specify the integration-test profile on the command line with the specified profile replacing the standard resources directory. Stranges this is happening on this OSX maven.. Run mvn -X help:effective-pom and compare the versions of EVERYTHING. Surely there is a difference that you just haven't noticed in a plugin or something. Once you find the difference, come back and tell us about it. Wayne - To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] View message @ http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3301286.html To unsubscribe from A classpath issue ?, click here. -- View this message in context: http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3301418.html Sent from the Maven - Users mailing list archive at Nabble.com.
Re: A classpath issue ?
The file does exist in the source directory: stephane:learnintouch$ ll core/src/main/resources/ -rwxr-xr-x 1 stephane staff 607 9 déc 17:34 spring-data-source.xml But it is nowhere to be found in the target directory: stephane:learnintouch$ll core/target/classes/ drwxr-xr-x 3 stephane staff 102 10 déc 17:43 com -rw-r--r-- 1 stephane staff 5359 10 déc 17:43 spring-hibernate-dao.xml -rw-r--r-- 1 stephane staff 2760 10 déc 17:43 spring-hibernate.xml -rw-r--r-- 1 stephane staff 529 10 déc 17:43 spring-service.xml stephane:learnintouch$ll core/target/test-classes/ drwxr-xr-x 3 stephane staff 102 10 déc 17:43 com stephane:learnintouch$ The file has not been copied into the target directory. Strange.. -- View this message in context: http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3300609.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: A classpath issue ?
I'm running the following version of maven: stephane:learnintouch/$ mvn -version Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.6.0_22 Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: fr_FR, platform encoding: MacRoman OS name: mac os x version: 10.6.5 arch: x86_64 Family: mac -- View this message in context: http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3300635.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: A classpath issue ?
That's because you haven't configured that folder in the profile. This is what you have configured: resources resource directorysrc/integration/ resources/directory filteringtrue/filtering /resource /resources This replaces the resources section defined outside the profiles. Execute this and check the effective pom: mvn help:effective-pom -P integration-test /Anders On Fri, Dec 10, 2010 at 17:16, Stephane-3 mittiprove...@yahoo.se wrote: Hi, I have a maven build that is doing fine on my old linux box. Trying now to run it in the new iMac environment, I get an issue with a spring xml file not being found. It feels like the classpath is not correctly set. The pom.xml file is: 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; modelVersion4.0.0/modelVersion groupIdcom.thalasoft/groupId artifactIdlearnintouch/artifactId packagingpom/packaging version1.0-SNAPSHOT/version namelearnintouch/name urlhttp://www.thalasoft.com/url modules modulecore/module /modules properties spring.core.version2.5.6/spring.core.version hibernate.version3.6.0.Final/hibernate.version test.source.dirsrc/test/java/test.source.dir /properties build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target encodingUTF-8/encoding /configuration /plugin /plugins testSourceDirectory ${test.source.dir} /testSourceDirectory /build profiles profile iddefault/id activation activeByDefaulttrue/activeByDefault /activation properties /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/main/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idintegration-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/integration/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idmysql-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource /resources /build /profile /profiles repositories repository idJBoss repository/id url https://repository.jboss.org/nexus/content/groups/public-jboss/url /repository repository idUsertype/id urlhttp://repo1.maven.org/maven2/org/jadira/url /repository /repositories dependencyManagement dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.4/version scopetest/scope /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.16/version /dependency dependency groupIdjavax.mail/groupId artifactIdmail/artifactId version1.4/version /dependency dependency groupIdjoda-time/groupId artifactIdjoda-time/artifactId version1.6/version /dependency dependency groupIdorg.jadira.usertype/groupId artifactIdusertype.jodatime/artifactId version1.7/version /dependency
Re: A classpath issue ?
Hmm, I now see that you say it works on Linux. Maybe the resources section outside the profiles isn't being replaced but added to? Check the effective pom and you'll know for sure. /Anders On Fri, Dec 10, 2010 at 22:52, Anders Hammar and...@hammar.net wrote: That's because you haven't configured that folder in the profile. This is what you have configured: resources resource directorysrc/integration/ resources/directory filteringtrue/filtering /resource /resources This replaces the resources section defined outside the profiles. Execute this and check the effective pom: mvn help:effective-pom -P integration-test /Anders On Fri, Dec 10, 2010 at 17:16, Stephane-3 mittiprove...@yahoo.se wrote: Hi, I have a maven build that is doing fine on my old linux box. Trying now to run it in the new iMac environment, I get an issue with a spring xml file not being found. It feels like the classpath is not correctly set. The pom.xml file is: 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; modelVersion4.0.0/modelVersion groupIdcom.thalasoft/groupId artifactIdlearnintouch/artifactId packagingpom/packaging version1.0-SNAPSHOT/version namelearnintouch/name urlhttp://www.thalasoft.com/url modules modulecore/module /modules properties spring.core.version2.5.6/spring.core.version hibernate.version3.6.0.Final/hibernate.version test.source.dirsrc/test/java/test.source.dir /properties build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target encodingUTF-8/encoding /configuration /plugin /plugins testSourceDirectory ${test.source.dir} /testSourceDirectory /build profiles profile iddefault/id activation activeByDefaulttrue/activeByDefault /activation properties /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/main/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idintegration-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/integration/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idmysql-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource /resources /build /profile /profiles repositories repository idJBoss repository/id url https://repository.jboss.org/nexus/content/groups/public-jboss/url /repository repository idUsertype/id urlhttp://repo1.maven.org/maven2/org/jadira /url /repository /repositories dependencyManagement dependencies dependency groupIdjunit/groupId artifactIdjunit/artifactId version4.4/version scopetest/scope /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.16/version /dependency dependency groupIdjavax.mail/groupId artifactIdmail/artifactId version1.4/version /dependency dependency groupIdjoda-time/groupId artifactIdjoda-time/artifactId
Re : A classpath issue ?
I just ran the following command, on the Linux box: mvn help:effective-pom -Pintegration-test And it gives the following output: sourceDirectory/home/stephane/dev/java/project/learnintouch/src/main/java/sourceDirectory^M scriptSourceDirectorysrc/main/scripts/scriptSourceDirectory^M testSourceDirectory/home/stephane/dev/java/project/learnintouch/src/integration/java/testSourceDirectory^M outputDirectory/home/stephane/dev/java/project/learnintouch/target/classes/outputDirectory^M testOutputDirectory/home/stephane/dev/java/project/learnintouch/target/test-classes/testOutputDirectory^M resources^M resource^M filteringtrue/filtering^M mergeIdresource-0/mergeId^M directory/home/stephane/dev/java/project/learnintouch/src/main/resources/directory^M /resource^M resource^M filteringtrue/filtering^M mergeIdresource-1/mergeId^M directory/home/stephane/dev/java/project/learnintouch/src/integration/resources/directory^M /resource^M /resources^M testResources^M testResource^M mergeIdresource-2/mergeId^M directory/home/stephane/dev/java/project/learnintouch/src/test/resources/directory^M /testResource^M /testResources^M directory/home/stephane/dev/java/project/learnintouch/target/directory I shall now run it on the iMac machine. De : Anders Hammar [via Maven] ml-node+3301035-833614543-63...@n5.nabble.com À : Stephane-3 mittiprove...@yahoo.se Envoyé le : Ven 10 décembre 2010, 22h 55min 14s Objet : Re: A classpath issue ? Hmm, I now see that you say it works on Linux. Maybe the resources section outside the profiles isn't being replaced but added to? Check the effective pom and you'll know for sure. /Anders On Fri, Dec 10, 2010 at 22:52, Anders Hammar [hidden email] wrote: That's because you haven't configured that folder in the profile. This is what you have configured: resources resource directorysrc/integration/ resources/directory filteringtrue/filtering /resource /resources This replaces the resources section defined outside the profiles. Execute this and check the effective pom: mvn help:effective-pom -P integration-test /Anders On Fri, Dec 10, 2010 at 17:16, Stephane-3 [hidden email] wrote: Hi, I have a maven build that is doing fine on my old linux box. Trying now to run it in the new iMac environment, I get an issue with a spring xml file not being found. It feels like the classpath is not correctly set. The pom.xml file is: 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; modelVersion4.0.0/modelVersion groupIdcom.thalasoft/groupId artifactIdlearnintouch/artifactId packagingpom/packaging version1.0-SNAPSHOT/version namelearnintouch/name urlhttp://www.thalasoft.com/url modules modulecore/module /modules properties spring.core.version2.5.6/spring.core.version hibernate.version3.6.0.Final/hibernate.version test.source.dirsrc/test/java/test.source.dir /properties build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target encodingUTF-8/encoding /configuration /plugin /plugins testSourceDirectory ${test.source.dir} /testSourceDirectory /build profiles profile iddefault/id activation activeByDefaulttrue/activeByDefault /activation properties /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/main/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idintegration-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/integration/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource
Re : A classpath issue ?
And the same command on the iMac machine: sourceDirectory/Users/stephane/dev/java/projects/learnintouch/core/src/main/java/sourceDirectory scriptSourceDirectorysrc/main/scripts/scriptSourceDirectory testSourceDirectory/Users/stephane/dev/java/projects/learnintouch/core/src/integration/java/testSourceDirectory outputDirectory/Users/stephane/dev/java/projects/learnintouch/core/target/classes/outputDirectory testOutputDirectory/Users/stephane/dev/java/projects/learnintouch/core/target/test-classes/testOutputDirectory resources resource filteringtrue/filtering mergeIdresource-2/mergeId directory/Users/stephane/dev/java/projects/learnintouch/core/src/integration/resources/directory /resource /resources testResources testResource mergeIdresource-3/mergeId directory/Users/stephane/dev/java/projects/learnintouch/core/src/test/resources/directory /testResource /testResources directory/Users/stephane/dev/java/projects/learnintouch/core/target/directory Indeed, the standard resources directory is missing. De : Anders Hammar [via Maven] ml-node+3301035-833614543-63...@n5.nabble.com À : Stephane-3 mittiprove...@yahoo.se Envoyé le : Ven 10 décembre 2010, 22h 55min 14s Objet : Re: A classpath issue ? Hmm, I now see that you say it works on Linux. Maybe the resources section outside the profiles isn't being replaced but added to? Check the effective pom and you'll know for sure. /Anders On Fri, Dec 10, 2010 at 22:52, Anders Hammar [hidden email] wrote: That's because you haven't configured that folder in the profile. This is what you have configured: resources resource directorysrc/integration/ resources/directory filteringtrue/filtering /resource /resources This replaces the resources section defined outside the profiles. Execute this and check the effective pom: mvn help:effective-pom -P integration-test /Anders On Fri, Dec 10, 2010 at 17:16, Stephane-3 [hidden email] wrote: Hi, I have a maven build that is doing fine on my old linux box. Trying now to run it in the new iMac environment, I get an issue with a spring xml file not being found. It feels like the classpath is not correctly set. The pom.xml file is: 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; modelVersion4.0.0/modelVersion groupIdcom.thalasoft/groupId artifactIdlearnintouch/artifactId packagingpom/packaging version1.0-SNAPSHOT/version namelearnintouch/name urlhttp://www.thalasoft.com/url modules modulecore/module /modules properties spring.core.version2.5.6/spring.core.version hibernate.version3.6.0.Final/hibernate.version test.source.dirsrc/test/java/test.source.dir /properties build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target encodingUTF-8/encoding /configuration /plugin /plugins testSourceDirectory ${test.source.dir} /testSourceDirectory /build profiles profile iddefault/id activation activeByDefaulttrue/activeByDefault /activation properties /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/main/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idintegration-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/integration/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idmysql-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/main/filters/data-source.properties/filter
Re : A classpath issue ?
And, again on the iMac, if this time I don't specify the integration-test profile on the command line mvn help:effective-pom I get sourceDirectory/Users/stephane/dev/java/projects/learnintouch/core/src/main/java/sourceDirectory scriptSourceDirectorysrc/main/scripts/scriptSourceDirectory testSourceDirectory/Users/stephane/dev/java/projects/learnintouch/core/src/test/java/testSourceDirectory outputDirectory/Users/stephane/dev/java/projects/learnintouch/core/target/classes/outputDirectory testOutputDirectory/Users/stephane/dev/java/projects/learnintouch/core/target/test-classes/testOutputDirectory resources resource filteringtrue/filtering mergeIdresource-2/mergeId directory/Users/stephane/dev/java/projects/learnintouch/core/src/main/resources/directory /resource /resources testResources testResource mergeIdresource-3/mergeId directory/Users/stephane/dev/java/projects/learnintouch/core/src/test/resources/directory /testResource /testResources directory/Users/stephane/dev/java/projects/learnintouch/core/target/directory with the specified profile replacing the standard resources directory. Stranges this is happening on this OSX maven.. De : Anders Hammar [via Maven] ml-node+3301035-833614543-63...@n5.nabble.com À : Stephane-3 mittiprove...@yahoo.se Envoyé le : Ven 10 décembre 2010, 22h 55min 14s Objet : Re: A classpath issue ? Hmm, I now see that you say it works on Linux. Maybe the resources section outside the profiles isn't being replaced but added to? Check the effective pom and you'll know for sure. /Anders On Fri, Dec 10, 2010 at 22:52, Anders Hammar [hidden email] wrote: That's because you haven't configured that folder in the profile. This is what you have configured: resources resource directorysrc/integration/ resources/directory filteringtrue/filtering /resource /resources This replaces the resources section defined outside the profiles. Execute this and check the effective pom: mvn help:effective-pom -P integration-test /Anders On Fri, Dec 10, 2010 at 17:16, Stephane-3 [hidden email] wrote: Hi, I have a maven build that is doing fine on my old linux box. Trying now to run it in the new iMac environment, I get an issue with a spring xml file not being found. It feels like the classpath is not correctly set. The pom.xml file is: 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; modelVersion4.0.0/modelVersion groupIdcom.thalasoft/groupId artifactIdlearnintouch/artifactId packagingpom/packaging version1.0-SNAPSHOT/version namelearnintouch/name urlhttp://www.thalasoft.com/url modules modulecore/module /modules properties spring.core.version2.5.6/spring.core.version hibernate.version3.6.0.Final/hibernate.version test.source.dirsrc/test/java/test.source.dir /properties build plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-compiler-plugin/artifactId configuration source1.6/source target1.6/target encodingUTF-8/encoding /configuration /plugin /plugins testSourceDirectory ${test.source.dir} /testSourceDirectory /build profiles profile iddefault/id activation activeByDefaulttrue/activeByDefault /activation properties /properties build filters filtersrc/main/filters/data-source.properties/filter /filters resources resource directorysrc/main/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idintegration-test/id properties test.source.dirsrc/integration/java/test.source.dir /properties build filters filtersrc/integration/filters/data-source.properties/filter /filters resources resource directorysrc/integration/resources/directory filteringtrue/filtering /resource /resources /build /profile profile idmysql-test/id properties test.source.dirsrc
Re: Re : A classpath issue ?
And, again on the iMac, if this time I don't specify the integration-test profile on the command line with the specified profile replacing the standard resources directory. Stranges this is happening on this OSX maven.. Run mvn -X help:effective-pom and compare the versions of EVERYTHING. Surely there is a difference that you just haven't noticed in a plugin or something. Once you find the difference, come back and tell us about it. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Test classpath issue with v2.0.8 and v2.0.9
jlo_gestalt wrote: When trying to access test resources in my unit tests, maven 2.0.8 and above are returning the wrong directory. Here is my basic code to access the folder def file = new JmblXsltDriverTest().getClass().getResource(/)?.file println file On 2.0.7 this would print /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/test-classes/ On 2.0.8 and 2.0.9 this prints /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/classes/ To me this is a critical bug that would almost certainly cause every projects unit tests that access test resources to fail. I'm going to guess you're encountering the bug described here: http://docs.codehaus.org/display/MAVENUSER/Classpath+Ordering+Bugs+in+Maven+Surefire Upgrading Surefire will probably restore you to the correct behavior. -Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Test classpath issue with v2.0.8 and v2.0.9
I have a couple of observations... First off I see you're writing you unit tests in Groovy! That's a good thing of course for far too many reasons. It's also an important detail to pay attention to. There are a hole host of other details to look at as well. Secondly it appears you are trying to query for the resource folder using code. This is not a good thing or a necessary thing to do. Maven will put all of your test resources under the test-classes folder unless something else somewhere else tells it not to. Another detail is that your code is asking the wrong question and may have been mistakenly getting at the right answer all along. It asks the location of it's execution folder not the location of the resource folder. I can show you the correct hack to locating the resource folder involving a marker file which you could run and arrive at a more accurate answer. More on that later. Here's the important things to consider. Groovy is interpreted/compiled. Running that same groovy code through a plugin (like the Groovy plugin or Ant run) would place compiled classes in your classes output folder. In one case I'm assuming the code was being copied from the test/resources to the test-classes folder and in another case it is possibly being filtered. I can't tell without looking. Here's some things to look for. Find out where the Groovy code is being run from. Is it being both compiled to target/classes and copied over to target/test-classes as .groovy files? If so then there's some ambiguity worth cleaning up. What is it you are actually trying to do? Do you want to run the scripts or do you want to compile them? If you are compiling them make sure you point the compiler to the correct output folder. I feel like I'm babbling and confusing you more than helping but I'm sure your problem lies in whther you compile to the correct output folder or copy to the correct output folder. Look for filters that may have been added as well. jlo_gestalt wrote: When trying to access test resources in my unit tests, maven 2.0.8 and above are returning the wrong directory. Here is my basic code to access the folder def file = new JmblXsltDriverTest().getClass().getResource(/)?.file println file On 2.0.7 this would print /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/test-classes/ On 2.0.8 and 2.0.9 this prints /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/classes/ To me this is a critical bug that would almost certainly cause every projects unit tests that access test resources to fail. -- View this message in context: http://www.nabble.com/Test-classpath-issue-with-v2.0.8-and-v2.0.9-tp17276386p17281319.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Test classpath issue with v2.0.8 and v2.0.9
I disagree with you on accessing the resources my way, but that is for another post. Anyways, I was able to upgrade to maven 2.0.8 and surefire plugin 2.4.3 and things worked as expected. The only unfortunate thing is that now it won't work on maven 2.0.7, but oh well. Clifton wrote: I have a couple of observations... First off I see you're writing you unit tests in Groovy! That's a good thing of course for far too many reasons. It's also an important detail to pay attention to. There are a hole host of other details to look at as well. Secondly it appears you are trying to query for the resource folder using code. This is not a good thing or a necessary thing to do. Maven will put all of your test resources under the test-classes folder unless something else somewhere else tells it not to. Another detail is that your code is asking the wrong question and may have been mistakenly getting at the right answer all along. It asks the location of it's execution folder not the location of the resource folder. I can show you the correct hack to locating the resource folder involving a marker file which you could run and arrive at a more accurate answer. More on that later. Here's the important things to consider. Groovy is interpreted/compiled. Running that same groovy code through a plugin (like the Groovy plugin or Ant run) would place compiled classes in your classes output folder. In one case I'm assuming the code was being copied from the test/resources to the test-classes folder and in another case it is possibly being filtered. I can't tell without looking. Here's some things to look for. Find out where the Groovy code is being run from. Is it being both compiled to target/classes and copied over to target/test-classes as .groovy files? If so then there's some ambiguity worth cleaning up. What is it you are actually trying to do? Do you want to run the scripts or do you want to compile them? If you are compiling them make sure you point the compiler to the correct output folder. I feel like I'm babbling and confusing you more than helping but I'm sure your problem lies in whther you compile to the correct output folder or copy to the correct output folder. Look for filters that may have been added as well. jlo_gestalt wrote: When trying to access test resources in my unit tests, maven 2.0.8 and above are returning the wrong directory. Here is my basic code to access the folder def file = new JmblXsltDriverTest().getClass().getResource(/)?.file println file On 2.0.7 this would print /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/test-classes/ On 2.0.8 and 2.0.9 this prints /workspace/checkout/weather/trunk/jetjwis/jbi/jmbl-xslt/target/classes/ To me this is a critical bug that would almost certainly cause every projects unit tests that access test resources to fail. -- View this message in context: http://www.nabble.com/Test-classpath-issue-with-v2.0.8-and-v2.0.9-tp17276386p17283178.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: M2 Classpath issue
This has come up several times on this list, as recently as a week ago, and people have discussed strategies for dealing with it etc. One thread in particular you will want to read is: date Mar 5, 2008 5:07 PM subject java.class.path and the surefire-plugin For more info, go to Nabble.com and search the list archives for java.class.path. Wayne On 3/13/08, ben short [EMAIL PROTECTED] wrote: Hi, I am adding some Unit tests to a legacy application before I make any changes. As part of the tests I start the application. When the application starts it scans all the classes on the classpath. Unfortunately the only jar on the classpath is the classworlds.jar due to the way maven handles dependencies. The application will use a system property called java.class.path if present. So I have configured the surefire plugin as shown below. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId version2.3/version configuration workingDirectory${basedir}\target\test-classes/workingDirectory systemProperties property namejava.class.path/name value${project.testClasspathElements}/value /property /systemProperties includes includenexusalpha/**/*Tests*/include /includes excludes excludenexusalpha/jaf2/services/webservice/AlertServerWebServiceTests*.java/exclude /excludes reportFormatbrief/reportFormat useFilefalse/useFile skipfalse/skip /configuration /plugin Unfortunately when i run the tests the application prints that the value for the system property java.class.path is ${project.testClasspathElements}. So it seems that maven is not filtering this property correctly. As a quick test i added ${project.testClasspathElements} to the workingDirectory element I see that maven complains that the workingDirectory is not valid and on inspection i see that the projects dependencies are listed correctly. Can anyone help me out with this? I'm using maven 2.0.8. Regards Ben Short - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: M2 Classpath issue
Wayne, Thanks for pointing this out. Regards Ben Short On Thu, Mar 13, 2008 at 2:39 PM, Wayne Fay [EMAIL PROTECTED] wrote: This has come up several times on this list, as recently as a week ago, and people have discussed strategies for dealing with it etc. One thread in particular you will want to read is: date Mar 5, 2008 5:07 PM subject java.class.path and the surefire-plugin For more info, go to Nabble.com and search the list archives for java.class.path. Wayne On 3/13/08, ben short [EMAIL PROTECTED] wrote: Hi, I am adding some Unit tests to a legacy application before I make any changes. As part of the tests I start the application. When the application starts it scans all the classes on the classpath. Unfortunately the only jar on the classpath is the classworlds.jar due to the way maven handles dependencies. The application will use a system property called java.class.path if present. So I have configured the surefire plugin as shown below. plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-surefire-plugin/artifactId version2.3/version configuration workingDirectory${basedir}\target\test-classes/workingDirectory systemProperties property namejava.class.path/name value${project.testClasspathElements}/value /property /systemProperties includes includenexusalpha/**/*Tests*/include /includes excludes excludenexusalpha/jaf2/services/webservice/AlertServerWebServiceTests*.java/exclude /excludes reportFormatbrief/reportFormat useFilefalse/useFile skipfalse/skip /configuration /plugin Unfortunately when i run the tests the application prints that the value for the system property java.class.path is ${project.testClasspathElements}. So it seems that maven is not filtering this property correctly. As a quick test i added ${project.testClasspathElements} to the workingDirectory element I see that maven complains that the workingDirectory is not valid and on inspection i see that the projects dependencies are listed correctly. Can anyone help me out with this? I'm using maven 2.0.8. Regards Ben Short - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [M2] Classpath issue
No, there is definitely only one version in the classpath, and I'm not sure how that would cause a ClassNotFoundException. This is the root exception: Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:1 21) at com.fja.pm.dataaccess.config.Configurator.init(Configurator.java:30) ... 44 more But it only happens in Surefire, runs fine in Eclipse. -Original Message- From: Marcos Silva Pereira [mailto:[EMAIL PROTECTED] Sent: Friday, February 23, 2007 4:44 PM To: Maven Users List Subject: Re: [M2] Classpath issue There is some other version of xerces in your classpath? Kind Regards, On 2/23/07, Siegmann Daniel, NY [EMAIL PROTECTED] wrote: I am trying to convert a project from Maven1 to Maven2. Should be simple, but I am getting a ClassNotFoundException on the following line in my code when running JUnit tests through Maven: XMLReaderFactory.createXMLReader(org.apache.xerces.parsers.SAXParser ) This class is in xerces-2.4.0.jar, I have verified. This is listed as a dependency, and the -X option confirms it should be on the classpath. I built the eclipse files and ran the test, no problem - I had to remove some nested directories listed under resources, but this shouldn't have any effect on class loading. Any ideas what could be causing this problem? I don't even know how to debug this. :( -- Daniel Siegmann FJA-US, Inc. 512 Seventh Ave., New York, NY 10018 (212) 840-2618 ext. 139 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Marcos Silva Pereira recife - pe [EMAIL PROTECTED] skype: marcos.silva.pereira http://blastemica.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [M2] Classpath issue
There is some other version of xerces in your classpath? Kind Regards, On 2/23/07, Siegmann Daniel, NY [EMAIL PROTECTED] wrote: I am trying to convert a project from Maven1 to Maven2. Should be simple, but I am getting a ClassNotFoundException on the following line in my code when running JUnit tests through Maven: XMLReaderFactory.createXMLReader(org.apache.xerces.parsers.SAXParser) This class is in xerces-2.4.0.jar, I have verified. This is listed as a dependency, and the -X option confirms it should be on the classpath. I built the eclipse files and ran the test, no problem - I had to remove some nested directories listed under resources, but this shouldn't have any effect on class loading. Any ideas what could be causing this problem? I don't even know how to debug this. :( -- Daniel Siegmann FJA-US, Inc. 512 Seventh Ave., New York, NY 10018 (212) 840-2618 ext. 139 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Marcos Silva Pereira recife - pe [EMAIL PROTECTED] skype: marcos.silva.pereira http://blastemica.blogspot.com
Re: Spring classpath issue
hi, my 2 cents. what's hte scope of your dependency? is it compile? hth marco On 12/9/06, Morgovsky, Alexander (US - Glen Mills) [EMAIL PROTECTED] wrote: I have a Spring .jar which has a Spring properties file. I created a dependency on this .jar file but it did not get picked up during integration-test. Does anyone know why this may be? Thanks. This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. [v.E.1]
Re: Plugin classpath issue
On 9/30/06, Kevin Menard [EMAIL PROTECTED] wrote: Hi, I'm working on a plugin that I'd like to have invoked from the CLI, much like the jetty plugin. I'm having difficulty in getting the classpath to work out the way I'd like though. I have a dependency listed and can use classes from that dependency, but transitive dependencies don't seem to be working. So, while I can use classes in my own dependency list, they can't use anything from their subsequent dependencies. I've tried using @requiresDependencyResolution, but that didn't help. Try using @requiresDependencyResolution runtime. Then ${project.artifacts} should give you all the dependencies I believe. -- Cheers, Kristian
Re: test:test classpath issue
Why do you want your test code (ie .java files) copied to your classpath? On Fri, 10 Sep 2004 18:46:57 -0600, Derek Greer [EMAIL PROTECTED] wrote: I have a JUnit test which works fine from an Ant task, but when I run maven test:test it fails due to a ClassNotFoundException. Can someone inform me of how to get Maven to add my classes to its classpath? My project.xml contains the following: unitTestSourceDirectorysrc/test/unitTestSourceDirectory unitTest resources resource directory${basedir}/src/test/directory includes include**/*Test.java/include /includes /resource /resources /unitTest Derek Greer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.multitask.com.au/people/dion/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: test:test classpath issue
Never mind. I had my package prefixed with test. I'm guessing the norm is to store unittest cases under src/test but not actually designate test as part of the package name? Derek Derek Greer wrote: I have a JUnit test which works fine from an Ant task, but when I run maven test:test it fails due to a ClassNotFoundException. Can someone inform me of how to get Maven to add my classes to its classpath? My project.xml contains the following: unitTestSourceDirectorysrc/test/unitTestSourceDirectory unitTest resources resource directory${basedir}/src/test/directory includes include**/*Test.java/include /includes /resource /resources /unitTest Derek Greer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]