mvn install -DskipTests=true may work too

On Wed, Jan 13, 2010 at 11:37 PM, Jörg Schaible <joerg.schai...@gmx.de> wrote:
> Hi Andreas,
>
> Andreas Sewe wrote at Mittwoch, 13. Januar 2010 17:12:
>
>> Hi all,
>>
>> I have three Maven projects example:A:1.0, example:B:1.0, and
>> example:C:1.0. The former aggregates the two latter projects.
>>
>> Now project example:B:1.0 attaches a test-jar to is primary artifact (as
>> per <http://maven.apache.org/guides/mini/guide-attached-tests.html>).
>>
>> Project C has a "test" scoped dependency on this attached artifact:
>> example:B:test-jar:tests:1.0. (again, per the mini guide.)
>>
>> Now, if I use Maven to install the aggregator project A like so
>>
>>    mvn clean install -Dmaven.test.skip=true
>>
>> and my local repository is initially void of
>> example:B:test-jar:tests:1.0, I get a build failure.
>>
>> While this seems to be related to
>> <http://jira.codehaus.org/browse/MNG-2045>, I am not sure its the same
>> issue, as the following *does* work:
>>
>>    mvn clean install
>>
>> This properly installs example:B:test-jar:tests:1.0 when building
>> project B, just in time before project C needs it.
>>
>> So, is the behavior when -Dmaven.skip.test=true a bug? Or need
>> test-scoped dependencies still present even if nobody actually uses
>> them? (FWIW, the behavior occurs using both Maven 2.2.1 and the
>> 3.0-SNAPSHOT embedded into M2Eclipse.)
>>
>> Thoughts?
>
> This is expected. The flag tells Maven to skip the complete test stuff i.e.
> also the compile phase and you will have an empty test jar. Therefore use
> -Dmaven.skip.test.exec=true to compile the test code, but skip the test
> execution.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to