Test dependency randomly fails

2006-10-05 Thread Naess, Ronny
Hi.

I am using maven-jar-plugin to build test dependencies with goal
'test-jar' like shown below.

plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
executions
execution
goals
goaltest-jar/goal
/goals
/execution
/executions
/plugin

This gives me myArtifactId-1.0-SNAPSHOT-tests.jar in addition to
myArtifactId-1.0-SNAPSHOT.jar



Artifacts using this dependency is then configured like this

dependency
groupIdmyGroupId/groupId
artifactIdmyArtifactId/artifactId
version1.0-SNAPSHOT/version
typetest-jar/type
scopetest/scope
/dependency
dependency
groupIdmyGroupId/groupId
artifactIdmyArtifactId/artifactId
version1.0-SNAPSHOT/version
/dependency


For some reason my test dependencies is not included correctly in the
testclasspath every time. While 'mvn -X test' shows correct classpath
the result is another thing. One artifact may build correct one time and
the next time not. In a sequence of builds (parent level) failure can
happen at different artifacts each time (without me changing anything in
between). Build once more and maybe one step further or maybe one step
back. The more artifacts we add to the build process the more hard it
becomes to have a successfully build in sequence.

For the record. My xxx-tests.jar artifacts does contain the correct
content in the repository. Or else it would not be possible to have
successfully builds for some artifacts and not others in one build. 

The strange thing and my question is, why does this not work for every
artifact/module every time??

-Ronny

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Test dependency randomly fails

2006-10-05 Thread Naess, Ronny
I think I might have found a BUG, but I am not sure where.

I have created a method that reads two test resource files from
classpath when my tests is executing. 

I have two artifacts with test jars:
- common-1.0-SNAPSHOT-tests.jar containing resource database.properties 
- jdbcDao-1.0-SNAPSHOT-tests.jar containing resource
incrementer-context.xml

The same two resource files exists in the main common and jdbcDao
artifacts.
Test resources spesifies HSQLDB and main resources Oracle.

When I run my tests (parent level) and the resources is listed/printed,
this is the result.  

| Artifact   | test database.properties | test incrementer-context.xml |

| artifact1  |OK| N/A  |

| artifact2  |OK| OK   |


| artifact3  |  MISSING | OK   |


Strange thing is that test resource database.properties was not found
only the main one. This means that common-1.0-SNAPSHOT-tests.jar is not
in test classpath, but since I ran 'mvn install -X' I can se the log
output saying that it is (last line):

[DEBUG] Test Classpath :
[DEBUG]
C:\ansattportal\dev\server\code\ansattportal-projectroom-service\target\
classes
[DEBUG]
C:\ansattportal\dev\server\code\ansattportal-projectroom-service\target\
test-classes
[DEBUG]   C:\Documents and
Settings\carna\.m2\repository\no\avinor\ansattportal-jdbcDao\1.0-SNAPSHO
T\ansattportal-jdbcDao-1.0-SNAPSHOT-tests.jar
[DEBUG]   C:\Documents and
Settings\carna\.m2\repository\oracle\jdbc\1.4\jdbc-1.4.jar
[DEBUG]   C:\Documents and
Settings\carna\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar
[DEBUG]   C:\Documents and
Settings\carna\.m2\repository\no\avinor\ansattportal-commons\1.0-SNAPSHO
T\ansattportal-commons-1.0-SNAPSHOT-tests.jar

Is this a BUG in maven-surefire-plugin or am I doing something wrong
here?

-Ronny


-Opprinnelig melding-
Fra: Naess, Ronny [mailto:[EMAIL PROTECTED] 
Sendt: 5. oktober 2006 13:18
Til: Maven Users List
Emne: Test dependency randomly fails

Hi.

I am using maven-jar-plugin to build test dependencies with goal
'test-jar' like shown below.

plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
executions
execution
goals
goaltest-jar/goal
/goals
/execution
/executions
/plugin

This gives me myArtifactId-1.0-SNAPSHOT-tests.jar in addition to
myArtifactId-1.0-SNAPSHOT.jar



Artifacts using this dependency is then configured like this

dependency
groupIdmyGroupId/groupId
artifactIdmyArtifactId/artifactId
version1.0-SNAPSHOT/version
typetest-jar/type
scopetest/scope
/dependency
dependency
groupIdmyGroupId/groupId
artifactIdmyArtifactId/artifactId
version1.0-SNAPSHOT/version
/dependency


For some reason my test dependencies is not included correctly in the
testclasspath every time. While 'mvn -X test' shows correct classpath
the result is another thing. One artifact may build correct one time and
the next time not. In a sequence of builds (parent level) failure can
happen at different artifacts each time (without me changing anything in
between). Build once more and maybe one step further or maybe one step
back. The more artifacts we add to the build process the more hard it
becomes to have a successfully build in sequence.

For the record. My xxx-tests.jar artifacts does contain the correct
content in the repository. Or else it would not be possible to have
successfully builds for some artifacts and not others in one build. 

The strange thing and my question is, why does this not work for every
artifact/module every time??

-Ronny

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


!DSPAM:4524edf7280511926716756!


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]