Maven 1.x Test Plugin

maven test plugin 1.6.2 test throws a ClassNotFound exception in a subtier level project

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Solaris 9, maven 1.0, sun jdk 1.4.2_03
  • Number of attachments :
    1

Description

when running a sub level project the test:compile somehow gets confused and doesn't include the <unitTest><includes>. hence, the test fails with a class not found on the Test class itself. the exact same project.xml file works fine in rc2. the debug output from 1.0:


test:compile:
[available] [DEBUG] class "X" was not found
[available] [VERBOSE] Unable to load class X to set property classPresent
[javac] [DEBUG] fileset: Setup scanner in dir /home/dflesner/ct/dev/ims/components/authn/components/authn-cmd/test/java with patternSet{ includes: [**/*Command.java] excludes: [**/package.html] }

--the same output from rc2--

test:compile:
[javac] [DEBUG] fileset: Setup scanner in dir /home/dflesner/ct/dev/ims/components/authn/components/authn-cmd/test/java with patternSet{ includes: [] excludes: [**/package.html] }
[javac] [VERBOSE] com/rsa/authn/LoginCommandTest.java added as com/rsa/authn/LoginCommandTest.class doesn't exist.
[javac] [VERBOSE] com/rsa/authn/LogoutCommandTest.java added as com/rsa/authn/LogoutCommandTest.class doesn't exist.
[javac] Compiling 2 source files to /home/dflesner/ct/dev/ims/components/authn/components/authn-cmd/target/test-classes

notice the includes is different. the includes is actually the src modifications not the test includes?

my project.xml excerpt

<build>
<sourceDirectory>../../src/java</sourceDirectory>

<resources>
<resource>
<directory>src/java/</directory>
<includes>
<include>*/.properties</include>
</includes>
</resource>
</resources>

<sourceModifications>
<sourceModification>
<className>X</className>
<includes>
<include>**/*Command.java</include>
</includes>
</sourceModification>
</sourceModifications>

<unitTestSourceDirectory>test/java</unitTestSourceDirectory>

<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
</unitTest>

</build>

---the actual error in the test log

Null Test: Caused an ERROR
com.rsa.authn.LoginCommandTest
java.lang.ClassNotFoundException: com.rsa.authn.LoginCommandTest
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)

Activity

Hide
Daniel Flesner added a comment -

debug output

Show
Daniel Flesner added a comment - debug output
Hide
Brett Porter added a comment -

inheritence was not behaving as it should in rc2, and was deliberately changed. I think this is it.

Can you detail the parent projects you have and what their build sections look like?

Thanks.

Show
Brett Porter added a comment - inheritence was not behaving as it should in rc2, and was deliberately changed. I think this is it. Can you detail the parent projects you have and what their build sections look like? Thanks.
Hide
Daniel Flesner added a comment -

---the included files build section:
<build>
<nagEmailAddress>IMS-dev@rsasecurity.com</nagEmailAddress>

<sourceDirectory>src/java</sourceDirectory>

<unitTestSourceDirectory>test/java</unitTestSourceDirectory>

<unitTest>
<resources>
<resource>
<directory>test/config</directory>
<includes>
<include>*.xsd</include>
<include>*.dtd</include>
<include>*.mod</include>
<include>*.properties</include>
</includes>
</resource>
</resources>
<includes>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>*/Abstract.java</exclude>
</excludes>
</unitTest>

<resources>
<resource>
<directory>src/config</directory>
<includes>
<include>*.xsd</include>
<include>*.dtd</include>
<include>*.mod</include>
<include>*.xml</include>
</includes>
</resource>
<resource>
<directory>src/config</directory>
<targetPath>src/config</targetPath>
<includes>
<include>*.properties</include>
</includes>
</resource>
</resources>
</build>

Show
Daniel Flesner added a comment - ---the included files build section: <build> <nagEmailAddress>IMS-dev@rsasecurity.com</nagEmailAddress> <sourceDirectory>src/java</sourceDirectory> <unitTestSourceDirectory>test/java</unitTestSourceDirectory> <unitTest> <resources> <resource> <directory>test/config</directory> <includes> <include>*.xsd</include> <include>*.dtd</include> <include>*.mod</include> <include>*.properties</include> </includes> </resource> </resources> <includes> <include>**/*Test.java</include> </includes> <excludes> <exclude>*/Abstract.java</exclude> </excludes> </unitTest> <resources> <resource> <directory>src/config</directory> <includes> <include>*.xsd</include> <include>*.dtd</include> <include>*.mod</include> <include>*.xml</include> </includes> </resource> <resource> <directory>src/config</directory> <targetPath>src/config</targetPath> <includes> <include>*.properties</include> </includes> </resource> </resources> </build>

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: