maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Connolly <stephen.alan.conno...@gmail.com>
Subject Re: Unit tests depending on manifest
Date Mon, 24 May 2010 21:04:51 GMT
better off using maven-failsafe-plugin for that

On 24 May 2010 20:00, kristian <m.kristian@web.de> wrote:

> run your tests after the package phase, i.e.
>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-surefire-plugin</artifactId>
>        <version>2.5</version>
>        <executions>
>          <execution>
>            <phase>integration-test</phase>
>            <goals>
>              <goal>test</goal>
>            </goals>
>            <configuration>
>
>  <testSourceDirectory>${basedir}/src/test2/java</testSourceDirectory>
>            </configuration>
>          </execution>
>        </executions>
>      </plugin>
>
> I have not tested it but it should work
>
> regards,
> Kristian
>
> On Mon, May 24, 2010 at 11:23 PM, Ernst de Haan <ernst@ernstdehaan.com>
> wrote:
> >> Instead of running that test in this module's build, add another
> >> module alongside it that depends on this artifact, and run this test
> >> there. It will bring in the jar which, as you said, has the manifest
> >> in it. You will need a parent pom as well over both modules, and
> >> always build your project from the parent.
> >
> > Another question: How do I make the test-module use the *JAR* instead of
> just the classes?
> >
> > Here's what I have done:
> > - create a separate "base-test" module with a separate POM that depends
> on the "base" module
> > - move all unit tests to the "base-test" module
> > - run "mvn clean" and then "mvn test"
> >
> > What happens is:
> > - the classes get compiled for the "base" module (but no JAR is
> generated)
> > - the unit tests in "base-test" are executed, using the classes (not the
> JAR)
> > - the tests (obviously) fail
> >
> > So I try forcing the JAR to be created, using "mvn install", which works.
> But still the unit tests fail, because they appear to use the classes
> instead of the JAR...
> >
> > Any hints to this next piece of the puzzle?
> >
> >
> > Ernst
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
>
> --
> Kristian Meier + Saumya Sharma + Sanuka Meier
> Vadakkethu House,
> Edayanmula West PO - 689532,
> Pathanamthitta District, Kerala, INDIA
>
> tel: +91 468 2319577
>
> protect your privacy while searching the net: www.ixquick.com
>
>             _=_
>           q(-_-)p
>            '_) (_`
>            /__/  \
>         _(<_   / )_
>      (__\_\_|_/__)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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