Sebastien,

you can explicitly configure the maven-jar plugin to jar your test code.
We do it this way:
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-jar-plugin</artifactId>
               <executions>
                   <execution>
                       <id>bundle-test-jar</id>
                       <phase>package</phase>
                       <goals>
                           <goal>test-jar</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>

it gets bound to the package phase so it's created during 'mvn package'.

It appends the "-tests" suffix to the jar, so that later, if you need
to refer to it (to copy it somewhere, for example or to declare a
dependency) you need to use the "test" classifier so that maven would
know to append the -tests suffix:
           <dependency>
               <groupId>org.marketcetera</groupId>
               <artifactId>core</artifactId>
               <version>${project.version}</version>
               <classifier>tests</classifier>
               <scope>test</scope>
           </dependency>


hope this helps.

--
Toli Kuznets
Marketcetera.org: Open-Source Trading Platform: download.run.trade.

On 7/14/06, Sebastien Pennec <[EMAIL PROTECTED]> wrote:
Hello,

I am trying to build a multi-module project. One module (core) is needed by 
another
module.

When I run mvn install, a jar with the core module is built, but it doesn't 
contain
the test classes, and I need them to be included. I've search through the
maven-jar-plugin site but nothing seems to do the trick.

I've already used a few assemblies and I guess I could use this to build the 
jar I
need, but then, the install command wouldn't use it automatically (right?).

Anybody knows how to specify what's supposed to be included in the jar? Or is 
there
another way to include my test classes in the jar?

Thanks a lot,

Sebastien

--
Sebastien Pennec
[EMAIL PROTECTED]

LOGBack: the generic, reliable, fast and flexible logging library for Java.

---------------------------------------------------------------------
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]

Reply via email to