maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane-3 <mittiprove...@yahoo.se>
Subject Re : A classpath issue ?
Date Sat, 11 Dec 2010 00:57:54 GMT

And the same command on the iMac machine:

     
 <sourceDirectory>/Users/stephane/dev/java/projects/learnintouch/core/src/main/java</sourceDirectory>

      <scriptSourceDirectory>src/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>
          <filtering>true</filtering>
          <mergeId>resource-2</mergeId>
         
 <directory>/Users/stephane/dev/java/projects/learnintouch/core/src/integration/resources</directory>

        </resource>
      </resources>
      <testResources>
        <testResource>
          <mergeId>resource-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-63258@n5.nabble.com>
À : Stephane-3 <mittiprovence@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> 
>          <directory>src/integration/ 
> resources</directory> 
>          <filtering>true</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"> 
>>        <modelVersion>4.0.0</modelVersion> 
>>        <groupId>com.thalasoft</groupId> 
>>        <artifactId>learnintouch</artifactId> 
>>        <packaging>pom</packaging> 
>>        <version>1.0-SNAPSHOT</version> 
>>        <name>learnintouch</name> 
>>        <url>http://www.thalasoft.com</url> 
>>        <modules> 
>>                <module>core</module> 
>>        </modules> 
>>        <properties> 
>>                <spring.core.version>2.5.6</spring.core.version> 
>>                <hibernate.version>3.6.0.Final</hibernate.version> 
>>                <test.source.dir>src/test/java</test.source.dir> 
>>        </properties> 
>>        <build> 
>>                <plugins> 
>>                        <plugin> 
>>                                <groupId>org.apache.maven.plugins</groupId>

>> 
>>  <artifactId>maven-compiler-plugin</artifactId> 
>>                                <configuration> 
>>                                        <source>1.6</source> 
>>                                        <target>1.6</target> 
>>                                        <encoding>UTF-8</encoding> 
>>                                </configuration> 
>>                        </plugin> 
>>                </plugins> 
>>    <testSourceDirectory> 
>>      ${test.source.dir} 
>>    </testSourceDirectory> 
>>        </build> 
>>  <profiles> 
>>    <profile> 
>>      <id>default</id> 
>>      <activation> 
>>        <activeByDefault>true</activeByDefault> 
>>      </activation> 
>>      <properties> 
>>      </properties> 
>>      <build> 
>>        <filters> 
>>          <filter>src/main/filters/data-source.properties</filter> 
>>        </filters> 
>>        <resources> 
>>        <resource> 
>>          <directory>src/main/resources</directory> 
>>          <filtering>true</filtering> 
>>        </resource> 
>>        </resources> 
>>      </build> 
>>    </profile> 
>>    <profile> 
>>      <id>integration-test</id> 
>>      <properties> 
>>        <test.source.dir>src/integration/java</test.source.dir> 
>>      </properties> 
>>      <build> 
>>        <filters> 
>>          <filter>src/integration/filters/data-source.properties</filter>

>>        </filters> 
>>        <resources> 
>>        <resource> 
>>          <directory>src/integration/resources</directory> 
>>          <filtering>true</filtering> 
>>        </resource> 
>>        </resources> 
>>      </build> 
>>    </profile> 
>>    <profile> 
>>      <id>mysql-test</id> 
>>      <properties> 
>>        <test.source.dir>src/integration/java</test.source.dir> 
>>      </properties> 
>>      <build> 
>>        <filters> 
>>          <filter>src/main/filters/data-source.properties</filter> 
>>        </filters> 
>>        <resources> 
>>        <resource> 
>>          <directory>src/integration/resources</directory> 
>>          <filtering>true</filtering> 
>>        </resource> 
>>        </resources> 
>>      </build> 
>>    </profile> 
>>  </profiles> 
>>        <repositories> 
>>                <repository> 
>>                        <id>JBoss repository</id> 
>>                        <url> 
>> https://repository.jboss.org/nexus/content/groups/public-jboss</url> 
>>                </repository> 
>>                <repository> 
>>                        <id>Usertype</id> 
>>                        <url>http://repo1.maven.org/maven2/org/jadira
>> </url> 
>>                </repository> 
>>        </repositories> 
>>        <dependencyManagement> 
>>                <dependencies> 
>>                        <dependency> 
>>                                <groupId>junit</groupId> 
>>                                <artifactId>junit</artifactId> 
>>                                <version>4.4</version> 
>>                                <scope>test</scope> 
>>                        </dependency> 
>>                        <dependency> 
>>                                <groupId>log4j</groupId> 
>>                                <artifactId>log4j</artifactId> 
>>                                <version>1.2.16</version> 
>>                        </dependency> 
>>            <dependency> 
>>        <groupId>javax.mail</groupId> 
>>        <artifactId>mail</artifactId> 
>>        <version>1.4</version> 
>>      </dependency> 
>>                        <dependency> 
>>                                <groupId>joda-time</groupId> 
>>                                <artifactId>joda-time</artifactId> 
>>                                <version>1.6</version> 
>>                        </dependency> 
>>      <dependency> 
>>        <groupId>org.jadira.usertype</groupId> 
>>        <artifactId>usertype.jodatime</artifactId> 
>>                                <version>1.7</version> 
>>                        </dependency> 
>>                        <dependency> 
>>                                <groupId>javax.transaction</groupId> 
>>                                <artifactId>jta</artifactId> 
>>                                <version>1.1</version> 
>>                        </dependency> 
>>                        <dependency> 
>>                          <groupId>org.hibernate</groupId> 
>>                          <artifactId>hibernate-entitymanager</artifactId>

>>        <version>${hibernate.version}</version> 
>>      </dependency> 
>>      <dependency> 
>>        <groupId>org.jasypt</groupId> 
>>        <artifactId>jasypt</artifactId> 
>>        <version>1.7</version> 
>>      </dependency> 
>>      <dependency> 
>>        <groupId>mysql</groupId> 
>>        <artifactId>mysql-connector-java</artifactId> 
>>        <version>5.1.12</version> 
>>      </dependency> 
>>                        <dependency> 
>>                                <groupId>hsqldb</groupId> 
>>                                <artifactId>hsqldb</artifactId> 
>>                                <version>1.8.0.8-brew</version> 
>>                                <scope>test</scope> 
>>                        </dependency> 
>>                        <dependency> 
>>                                <groupId>org.springframework</groupId>

>>                                <artifactId>spring</artifactId> 
>>                                <version>${spring.core.version}</version>

>>                        </dependency> 
>>                        <dependency> 
>>                                <groupId>org.springframework</groupId>

>>                                <artifactId>spring-orm</artifactId> 
>>                                <version>${spring.core.version}</version>

>>                        </dependency> 
>>                        <dependency> 
>>                                <groupId>org.springframework</groupId>

>>                                <artifactId>spring-test</artifactId> 
>>                                <version>${spring.core.version}</version>

>>                        </dependency> 
>>                        <!-- 
>>                                <dependency> 
>> <groupId>${project.groupId}</groupId> 
>>                                <artifactId>learnintouch-core</artifactId>

>>                                <version>${project.version}</version>

>> </dependency> 
>>                        --> 
>>                </dependencies> 
>>        </dependencyManagement> 
>> </project> 
>> 
>> I ran so command: 
>> 
>> mvn clean test -Pintegration-test -X 
>> 
>> and got the following output: 
>> 
>> [DEBUG]   (f) classpathElements = 
>> [/Users/stephane/dev/java/projects/learnintouch/core/target/test-classes, 
>> /Users/stephane/dev/java/projects/learnintouch/core/target/classes, 
>> /Users/stephane/.m2/repository/junit/junit/4.4/junit-4.4.jar, 
>> /Users/stephane/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar, 
>> /Users/stephane/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar, 
>> 
>>/Users/stephane/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar,
>>, 
>>
>> /Users/stephane/.m2/repository/joda-time/joda-time/1.6/joda-time-1.6.jar, 
>> 
>>/Users/stephane/.m2/repository/org/jadira/usertype/usertype.jodatime/1.7/usertype.jodatime-1.7.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/jadira/usertype/usertype.spi/1.7/usertype.spi-1.7.jar,
>>, 
>>
>> /Users/stephane/.m2/repository/javax/transaction/jta/1.1/jta-1.1.jar, 
>> 
>>/Users/stephane/.m2/repository/org/hibernate/hibernate-entitymanager/3.6.0.Final/hibernate-entitymanager-3.6.0.Final.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/hibernate/hibernate-core/3.6.0.Final/hibernate-core-3.6.0.Final.jar,
>>, 
>>
>> /Users/stephane/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar, 
>> 
>>/Users/stephane/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar,
>>, 
>>
>> /Users/stephane/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar, 
>> 
>>/Users/stephane/.m2/repository/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final.jar,
>>, 
>>
>> 
>> /Users/stephane/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar, 

>> 
>>/Users/stephane/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar,
>>, 
>>
>> /Users/stephane/.m2/repository/cglib/cglib/2.2/cglib-2.2.jar, 
>> /Users/stephane/.m2/repository/asm/asm/3.1/asm-3.1.jar, 
>> /Users/stephane/.m2/repository/javassist/javassist/ 
>> 3.12.0.GA/javassist-3.12.0.GA.jar, 
>> /Users/stephane/.m2/repository/org/jasypt/jasypt/1.7/jasypt-1.7.jar, 
>> 
>>/Users/stephane/.m2/repository/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/hsqldb/hsqldb/1.8.0.8-brew/hsqldb-1.8.0.8-brew.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring-orm/2.5.6/spring-orm-2.5.6.jar,
>>, 
>>
>> 
>> /Users/stephane/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring-beans/2.5.6/spring-beans-2.5.6.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring-core/2.5.6/spring-core-2.5.6.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring-context/2.5.6/spring-context-2.5.6.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring-tx/2.5.6/spring-tx-2.5.6.jar,
>>, 
>>
>> 
>>/Users/stephane/.m2/repository/org/springframework/spring-test/2.5.6/spring-test-2.5.6.jar]
>>] 
>>
>> 
>> The surefire report says: 
>> 
>> Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: 
>> IOException parsing XML document from class path resource 
>> [spring-data-source.xml]; nested exception is 
>> java.io.FileNotFoundException: 
>> class path resource [spring-data-source.xml] cannot be opened because it 
>> does not exist 
>> 
>> It is strange that I don't see the resources/ directory in the classpath. 
>> 
>> 
>> -- 
>> View this message in context: 
>> http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3300543.html
>> Sent from the Maven - Users mailing list archive at Nabble.com. 
>> 
>> --------------------------------------------------------------------- 
>> To unsubscribe, e-mail: [hidden email] 
>> For additional commands, e-mail: [hidden email] 
>> 
>> 
> 


________________________________
 
View message @ 
http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3301035.html
To unsubscribe from A classpath issue ?, click here. 



-- 
View this message in context: http://maven.40175.n5.nabble.com/A-classpath-issue-tp3300543p3301171.html
Sent from the Maven - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message