RE: IT test in src/test/java is not executed by failsafe:integration-test, or fails oddly with verify

2017-10-25 Thread KARR, DAVID
> -Original Message-
> From: KARR, DAVID
> Sent: Wednesday, October 25, 2017 10:56 AM
> To: users@maven.apache.org
> Subject: IT test in src/test/java is not executed by
> failsafe:integration-test, or fails oddly with verify
> 
> I work on a large multiproject build that mostly produces OSGi bundle
> artifacts.  The codebase has a lot of unit tests that work fine from the
> build.
> 
> We also have quite a few IT tests, but we only execute those from
> Eclipse, as the nature of the framework makes those tests unreliable.
> 
> I now want to write a small test of IT tests that WILL be run from
> maven, in a CI build.  I verified that the test behaves properly when
> run from Eclipse.
> 
> I put the test in "src/test/java", named it with the "*IT.java" pattern,
> and then tried to run "failsafe:integration-test".  It ran failsafe, but
> it didn't find any tests.
> 
> So, on advice from someone on StackOverflow, I added an "executions"
> block to the plugin declaration.  Adding "integration-test" to the goals
> list didn't make any difference, but when I added "verify" and then ran
> that goal from the command line, I got very odd results.
> 
> The following is an elided version of the pom:
> 
> 
>   http://maven.apache.org/POM/4.0.0http:/
> /maven.apache.org/xsd/maven-
> 4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www
> .w3.org/2001/XMLSchema-instance">
>   4.0.0
>   
>   ...
>   
>   usl-features-install
>   usl-features-install
>   https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__maven.apache.org&d=DwIFAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
> xy2uk0vYF_EA&m=W15vi5llM1SmJsj7-
> g2VFzZ5ukS3vXQL3Rsy29lSpys&s=vk_ZTOxGLHdUOjOv4Env7MsI-5-
> FKM1Di5FmCyO24sA&e= 
>   bundle
>   
>   UTF-
> 8
>   
>   
>   
>   
>   
> org.apache.maven.plugins
>   maven-failsafe-
> plugin
>   2.20.1
>   
>   
>   
>   
> verify
>   
> integration-test
>   
>   
>   
>   
>   
>   org.apache.felix
>   
> maven-bundle-plugin
>   
>   
>   org.codehaus.mojo
>   build-helper-maven-
> plugin
>   
>   
>   
> attach-artifacts
>   package
>   
>   
> attach-artifact
>   
>   
>   
>   ...
>   
>   
>   
>   
>   
>   
>   
>   
> 
> When I run "mvn failsafe:integration-test", I see the following:
> 
> [INFO] -
> ---
>   [INFO] Building usl-features-install 3.1.0-SNAPSHOT
>   [INFO] 
> 
>   [INFO]
>   [INFO] --- maven-failsafe-plugin:2.20.1:integration-test (default-
> cli) @ usl-features-install ---
>   [INFO]
>   [INFO] ---
>   [INFO]  T E S T S
>   [INFO] ---
>   [INFO]
>   [INFO] Results:
>   [INFO]
>   [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>   [INFO]
>   [INFO] 
> 
>   [INFO] BUILD SUCCESS
>   [INFO] 
> 
> 
> Running "mvn verify" did the following:
> 
> [INFO] --- maven-failsafe-plugin:2.20.1:integration-test (default) 

RE: IT test in src/test/java is not executed by failsafe:integration-test, or fails oddly with verify

2017-10-25 Thread KARR, DAVID
> -Original Message-
> From: Robert Patrick [mailto:robert.patr...@oracle.com]
> Sent: Wednesday, October 25, 2017 11:32 AM
> To: Maven Users List 
> Subject: RE: IT test in src/test/java is not executed by
> failsafe:integration-test, or fails oddly with verify
> 
> In our integration tests' parent POM, we configured the compiler plugin
> to run the test-compile goal:

Thanks for showing how you've configured these plugins, but what in this is 
intended to address the issues that I described?

> 
> org.apache.maven.plugins
> maven-compiler-plugin
> 
> 
> test-compile
> test-compile
> 
> testCompile
> 
> 
> 
> 
> 
> 
> 
> And the failsafe-plugin like this:
> 
> 
> org.apache.maven.plugins
> maven-failsafe-plugin
> 
> 
> system-integration-test
> integration-test
> 
> integration-test
> 
> 
> -Xmx2048m -XX:PermSize=128m -
> XX:MaxPermSize=256m
> 
> 
> ${project.build.directory}
> ${a2c-home}
> 
> 
> 
> java.io.tmpdir
> 
> ${project.build.directory}
> 
> 
> 
> 
> 
> system-test-verify
> verify
> 
> verify
> 
> 
> 
> 
> 
> In each test submodule POM, we simply add the following:
> 
> 
> org.apache.maven.plugins
> maven-compiler-plugin
> 
> 
> org.apache.maven.plugins
> maven-failsafe-plugin
> 
> 
> 
> -Original Message-
> From: KARR, DAVID [mailto:dk0...@att.com]
> Sent: Wednesday, October 25, 2017 12:56 PM
> To: users@maven.apache.org
> Subject: IT test in src/test/java is not executed by
> failsafe:integration-test, or fails oddly with verify
> 
> I work on a large multiproject build that mostly produces OSGi bundle
> artifacts.  The codebase has a lot of unit tests that work fine from the
> build.
> 
> We also have quite a few IT tests, but we only execute those from
> Eclipse, as the nature of the framework makes those tests unreliable.
> 
> I now want to write a small test of IT tests that WILL be run from
> maven, in a CI build.  I verified that the test behaves properly when
> run from Eclipse.
> 
> I put the test in "src/test/java", named it with the "*IT.java" pattern,
> and then tried to run "failsafe:integration-test".  It ran failsafe, but
> it didn't find any tests.
> 
> So, on advice from someone on StackOverflow, I added an "executions"
> block to the plugin declaration.  Adding "integration-test" to the goals
> list didn't make any difference, but when I added "verify" and then ran
> that goal from the command line, I got very odd results.
> 
> The following is an elided version of the pom:
> 
> 
>   http://maven.apache.org/POM/4.0.0http:/
> /maven.apache.org/xsd/maven-
> 4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www
> .w3.org/2001/XMLSchema-instance">
>   4.0.0
>   
>   ...
>   
>   usl-features-install
>   usl-features-install
>   https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__maven.apache.org&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057Sb
> K10&r=Ql5uwmbofQMW0iErugdCnFgO-
> CBGr_pt_OzwdxJosG0&m=Gdqqce41TF232jlBHJhZ-SIZC-k-
> d9PREKAleK9pw0E&s=qa36PW3OrelDpW11bDjEo6LjewMSAUzW7lmp0RUt2OE&e= 
>   bundle
>   
>   UTF-
> 8
>   
>   
>   
>   
>   
> org.apache.maven.plugins
>   maven-failsafe-
> plugin
>   2.20.1
>   
>   
>   
>   

RE: IT test in src/test/java is not executed by failsafe:integration-test, or fails oddly with verify

2017-10-25 Thread Robert Patrick
In our integration tests' parent POM, we configured the compiler plugin to run 
the test-compile goal:


org.apache.maven.plugins
maven-compiler-plugin


test-compile
test-compile

testCompile







And the failsafe-plugin like this:


org.apache.maven.plugins
maven-failsafe-plugin


system-integration-test
integration-test

integration-test


-Xmx2048m -XX:PermSize=128m 
-XX:MaxPermSize=256m


${project.build.directory}
${a2c-home}



java.io.tmpdir

${project.build.directory}





system-test-verify
verify

verify





In each test submodule POM, we simply add the following:


org.apache.maven.plugins
maven-compiler-plugin


org.apache.maven.plugins
maven-failsafe-plugin



-Original Message-
From: KARR, DAVID [mailto:dk0...@att.com] 
Sent: Wednesday, October 25, 2017 12:56 PM
To: users@maven.apache.org
Subject: IT test in src/test/java is not executed by failsafe:integration-test, 
or fails oddly with verify

I work on a large multiproject build that mostly produces OSGi bundle 
artifacts.  The codebase has a lot of unit tests that work fine from the build.

We also have quite a few IT tests, but we only execute those from Eclipse, as 
the nature of the framework makes those tests unreliable.

I now want to write a small test of IT tests that WILL be run from maven, in a 
CI build.  I verified that the test behaves properly when run from Eclipse.

I put the test in "src/test/java", named it with the "*IT.java" pattern, and 
then tried to run "failsafe:integration-test".  It ran failsafe, but it didn't 
find any tests.

So, on advice from someone on StackOverflow, I added an "executions" block to 
the plugin declaration.  Adding "integration-test" to the goals list didn't 
make any difference, but when I added "verify" and then ran that goal from the 
command line, I got very odd results.

The following is an elided version of the pom:



http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd"xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
4.0.0

...

usl-features-install
usl-features-install

https://urldefense.proofpoint.com/v2/url?u=http-3A__maven.apache.org&d=DwIFAg&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10&r=Ql5uwmbofQMW0iErugdCnFgO-CBGr_pt_OzwdxJosG0&m=Gdqqce41TF232jlBHJhZ-SIZC-k-d9PREKAleK9pw0E&s=qa36PW3OrelDpW11bDjEo6LjewMSAUzW7lmp0RUt2OE&e=
 
bundle


UTF-8





org.apache.maven.plugins

maven-failsafe-plugin
2.20.1




verify

integration-test





org.apache.felix

maven-bundle-plugin


org.

IT test in src/test/java is not executed by failsafe:integration-test, or fails oddly with verify

2017-10-25 Thread KARR, DAVID
I work on a large multiproject build that mostly produces OSGi bundle 
artifacts.  The codebase has a lot of unit tests that work fine from the build.

We also have quite a few IT tests, but we only execute those from Eclipse, as 
the nature of the framework makes those tests unreliable.

I now want to write a small test of IT tests that WILL be run from maven, in a 
CI build.  I verified that the test behaves properly when run from Eclipse.

I put the test in "src/test/java", named it with the "*IT.java" pattern, and 
then tried to run "failsafe:integration-test".  It ran failsafe, but it didn't 
find any tests.

So, on advice from someone on StackOverflow, I added an "executions" block to 
the plugin declaration.  Adding "integration-test" to the goals list didn't 
make any difference, but when I added "verify" and then ran that goal from the 
command line, I got very odd results.

The following is an elided version of the pom:


http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";
xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
4.0.0

...

usl-features-install
usl-features-install
http://maven.apache.org
bundle


UTF-8





org.apache.maven.plugins

maven-failsafe-plugin
2.20.1




verify

integration-test





org.apache.felix

maven-bundle-plugin


org.codehaus.mojo

build-helper-maven-plugin



attach-artifacts
package


attach-artifact



...









When I run "mvn failsafe:integration-test", I see the following:

[INFO] 

[INFO] Building usl-features-install 3.1.0-SNAPSHOT
[INFO] 

[INFO] 
[INFO] --- maven-failsafe-plugin:2.20.1:integration-test (default-cli) 
@ usl-features-install ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 

[INFO] BUILD SUCCESS
[INFO] 


Running "mvn verify" did the following:

[INFO] --- maven-failsafe-plugin:2.20.1:integration-test (default) @ 
usl-features-install ---
[INFO] 
[INFO] ---
[INFO]  T E S T S
[INFO] ---
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-failsafe-plugin:2.20.1:verify (default) @ 
usl-features-install ---
[INFO] 
--

Re: how to use both buildnumber-maven-plugin and maven-release-plugin

2017-10-25 Thread Stephen Coy
Doh! 

I misinterpreted the docs and was thinking that the flatten-maven-plugin was 
something only needed for multi-module projects…

Thanks for clearing that up.

 Steve C

> On 25 Oct 2017, at 7:46 pm, Karl Heinz Marbaise  wrote:
> 
> Hi,
> 
> On 25/10/17 08:50, Stephen Coy wrote:
>> Hi Pascal,
>> Unfortunately this method results in pom files being deployed with releases 
>> that do not have corresponding versions in them.
>> In fact, the version is literally:
>>  ${revision}
>> This results in build warnings for consumers of the released artifact.
> 
> If you like to use a property for the version. First you have to use Maven 
> 3.5.0+ and furthermore flatten-maven-plugin as described in the docs about 
> that[1].
> 
> Kind regards
> Karl Heinz Marbaise
> [1]: http://maven.apache.org/maven-ci-friendly.html
> 
>> Cheers,
>> Steve C
>>> On 24 Oct 2017, at 8:27 pm, Pascal  wrote:
>>> 
>>> For me it's hard to understand the problem you are having, it might help to
>>> specify the exact errors you are getting.
>>> 
>>> If you are willing to try something other than the release plugin, have a
>>> look at https://axelfontaine.com/blog/dead-burried.html
>>> 
>>> Cheers,
>>> 
>>> Pascal
>>> 
>>> 
>>> 2017-10-23 18:40 GMT+02:00 Justin Georgeson <
>>> justin.george...@halliburton.com>:
>>> 
 The 'clean verify' invoked by release:prepare fails in
 buildnumber-maven-plugin because pom.xml is modified. I can pass arguments
 to release:prepare have buildnumber-maven-plugin skip the check for
 modifications, but that check is one of the main motivations for using it
 in the first place. What are other people doing here?
 
> 
> -
> 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



Re: how to use both buildnumber-maven-plugin and maven-release-plugin

2017-10-25 Thread Karl Heinz Marbaise

Hi,

On 25/10/17 08:50, Stephen Coy wrote:

Hi Pascal,

Unfortunately this method results in pom files being deployed with releases 
that do not have corresponding versions in them.

In fact, the version is literally:

${revision}

This results in build warnings for consumers of the released artifact.


If you like to use a property for the version. First you have to use 
Maven 3.5.0+ and furthermore flatten-maven-plugin as described in the 
docs about that[1].


Kind regards
Karl Heinz Marbaise
[1]: http://maven.apache.org/maven-ci-friendly.html



Cheers,

Steve C


On 24 Oct 2017, at 8:27 pm, Pascal  wrote:

For me it's hard to understand the problem you are having, it might help to
specify the exact errors you are getting.

If you are willing to try something other than the release plugin, have a
look at https://axelfontaine.com/blog/dead-burried.html

Cheers,

Pascal


2017-10-23 18:40 GMT+02:00 Justin Georgeson <
justin.george...@halliburton.com>:


The 'clean verify' invoked by release:prepare fails in
buildnumber-maven-plugin because pom.xml is modified. I can pass arguments
to release:prepare have buildnumber-maven-plugin skip the check for
modifications, but that check is one of the main motivations for using it
in the first place. What are other people doing here?



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



[ANN] Apache Maven 3.5.2 Released

2017-10-25 Thread Stephen Connolly
The Apache Maven team is pleased to announce the release of the Apache
Maven 3.5.2

You can download the appropriate sources etc. from the download page

Contributors

The Apache Maven team would like to thank the following contributors,
without whom this release would not have been possible:

Code contributors:

- Mario Krizmanic
- Dejan Stojadinovic
- Anton Tanasenko
- Stefan Eicher

Issue reporters:

- Marcel Schutte
- Mario Krizmanic
- Charles Gould
- Brian Oxley
- Anton Tanasenko
- Gregor B. Rosenauer
- Sylwester Lachiewicz
- Stefan Eicher
- Manuel Ryan

Community testers participating in voting for this release series:

- Mark Derricutt
- Dejan Stojadinovic
- Thomas Collignon
- Grzegorz Grzybek
- Petar Tahchiev
- jieryn
- Petr Široký

Thank you for your time and feedback.


Release Notes - Maven - Version 3.5.2

Sub-tasks:

* [MNG-6186] - switch to improved HawtJNI
* [MNG-6280] - ArrayIndexOutOfBoundsException caused by pom.xml with
process instructions

Bugs:

* [MNG-5935] - Optional true getting lost in managed dependencies when
transitive
* [MNG-6127] - Fix plugin execution configuration interference
* [MNG-6148] - Can't package and assemble with JDK9/Jigsaw
* [MNG-6149] - MetadataResolutionResult#getGraph() never resolves
request type 'test'
* [MNG-6205] - Non-ascii chars in name element are displayed as
question marks in Win CLI output (regression)
* [MNG-6210] - can't load @SessionScoped/@MojoExecutionScoped
components from .mvn/extensions.xml
* [MNG-6223] - mvn -f outputs invalid error when specifying POM
directory
* [MNG-6233] - maven-resolver-provider mixes JRS 330 and Plexus
annotations
* [MNG-6234] - Regression 6182a208: library.jansi.path does not point
to proper directory
* [MNG-6240] - Duplicate components in plugin extension realm when
plugin depends on maven-aether-resolver
* [MNG-6242] - No color for maven on Cygwin

Improvements:

* [MNG-5457] - Show repository id when downloading or uploading from/to
a remote repository
* [MNG-6025] - Add a ProjectArtifactsCache similar to
PluginArtifactsCache
* [MNG-6123] - detect self references in POM and fail fast
* [MNG-6174] - Clean Up Maven Model
* [MNG-6196] - Update slf4j and simplify its color integration
* [MNG-6203] - Minor cleanup in MavenCli.java
* [MNG-6206] - We should produce a WARNING by using RELEASE, LATEST as
versions
* [MNG-6207] - Create WARNINGs in case of using system scope
* [MNG-6228] - Optionality not displayed in dependency tree when run in
debug mode

New Features:

* [MNG-6084] - Support JSR 250 annotations
* [MNG-6220] - Add CLI options to control color output

Tasks:

* [MNG-6167] - Clean up dependency mess (reported by dependency:analyze)
* [MNG-6258] - Upgrade to Maven Resolver 1.1.0

Enjoy,

-The Apache Maven team