Re: Help needed: maven-surefire-plugin is skipping/not finding tests

2018-07-26 Thread Tibor Digana
There is zero tests to run because you have globally specified a "groups"
but there are no tests annotated with such group in your project
hadoop-hdfs.
Try to come over this issue by specifying empty groups in this child.


Let's go back to your three questions.
1. The pluginManagement should be in parent and children should not
specify/override plugin version, unless necessary.
2. You can use the latest version 2.22.0 but groups is old feature
available in 2.21.0 or 2.20.0 too and earlier.
3. Fix for groups is on your side, since you specify groups in parent POM
it means all children should undergo the same principle and all tests
should be annotated with one group at least. In your case when you still
have test which are not annotated with groups is to make the "groups"
config parameter empty. You can run the Maven in debug mode (mvn -X ...)
and you can see how the parameter is set in this plugin.

T

On Thu, Jul 26, 2018 at 6:15 PM, Jun Huang 
wrote:

> Hi,
>
> Recently in our hadoop project, we added maven-surefire-plugin for running
> unit tests by categories.
>
> in hadoop root pom.xml:
>
>   
> junit
> junit
> 4.11
>   
> :
> :
>
> 
> org.apache.hadoop.classification.
> TestJUnitCategory$AllTests
> 4.11
> 
>
> 
>   org.apache.maven.plugins
>   maven-surefire-plugin
>   2.21.0
>   
> ${test.groups}
>   
> 
>
>
> 
>   flakies
>   
> org.apache.hadoop.classification.
> TestJUnitCategory$FlakiesTest
>   
> 
> 
>   stables
>   
> org.apache.hadoop.classification.
> TestJUnitCategory$StablesTest
>   
> 
> 
>   integrations
>   
> org.apache.hadoop.classification.TestJUnitCategory$
> IntegrationsTest
>   
> 
> 
>   none
>   
> !org.apache.hadoop.classification.
> TestJUnitCategory$AllTest
>   
> 
>   
>
> Invoking tests by category works fine: mvn -P integrations. However, our
> old fashioned unit test execution got skipped by this maven-surefire-plugin:
>
> 13:16:35 [INFO] --- maven-antrun-plugin:1.7:run (create-log-dir) @
> hadoop-hdfs ---
> 13:16:35 [INFO] Executing tasks
> 13:16:35
> 13:16:35 main:
> 13:16:35[delete] Deleting directory /tmp/tmp.o7flMN8505/src/
> ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/test/data
> 13:16:35 [mkdir] Created dir: /tmp/tmp.o7flMN8505/src/
> ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/test/data
> 13:16:35  [copy] Copying 16 files to /tmp/tmp.o7flMN8505/src/
> ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/test-classes/webapps
> 13:16:35 [INFO] Executed tasks
> 13:16:35 [INFO]
> 13:16:35 [INFO] --- maven-compiler-plugin:3.1:testCompile
> (default-testCompile) @ hadoop-hdfs ---
> 13:16:35 [INFO] Nothing to compile - all classes are up to date
> 13:16:35 [INFO]
> 13:16:35 [INFO] --- maven-surefire-plugin:2.20:test (default-test) @
> hadoop-hdfs ---
> 13:16:35 [INFO] Surefire report directory: /tmp/tmp.o7flMN8505/src/
> ghuang/ghuang/hadoop-hdfs-project/hadoop-hdfs/target/surefire-reports
> 13:16:35 [INFO] parallel='none', perCoreThreadCount=true, threadCount=0,
> useUnlimitedThreads=false, threadCountSuites=0, threadCountClasses=0,
> threadCountMethods=0, parallelOptimized=true
> 13:16:35 [INFO]
> 13:16:35 [INFO] ---
> 13:16:35 [INFO]  T E S T S
> 13:16:35 [INFO] ---
> 13:26:01 [INFO]
> 13:26:01 [INFO] Results:
> 13:26:01 [INFO]
> 13:26:01 [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 13:26:01 [INFO]
> 13:26:01 [INFO]
> 13:26:01 [INFO] --- maven-antrun-plugin:1.7:run (hdfs-test-bats-driver) @
> hadoop-hdfs ---
>
> I also verified that by removing surefire-plugin block in root pom.xml
> file will make these tests executing again as usual. So I have some
> questions here:
>
> 1. I saw the reported surefire-plugin version was 2.20 while I was
> defining 2.21 in my change. This is because it gets overwritten by the
> parent pom. So how do I make it use my customized version.
>
> 2. Is the version 2.21 the right version for this? I saw some post
> indicated version 2.21 might have some bug?
>
> 3. What is the fix for this issue?
>
>
> Many thanks,
> George
>
> See attached pom.xml file.
>
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>


Re: Problem with Maven Tutorial

2018-07-26 Thread Nick Stolwijk
You can add the properties tag directly under the root element ()
of your POM[1] file.


   1. 
   2. 1.8
   3. 1.8
   4. 


[1] Project Object Model

The default source level is still at 1.5, due to backward compatibility
issues.

Hth,

Nick Stolwijk

~~~ Try to leave this world a little better than you found it and, when
your turn comes to die, you can die happy in feeling that at any rate you
have not wasted your time but have done your best ~~~

Lord Baden-Powell


On Thu, Jul 26, 2018 at 10:09 PM Scott Miller  wrote:

> Hi,
>
> I am trying to use Maven for the first time.  I have it installed and  was
> working on this tutorial:
>
> https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
>
> I got to this step:
>
>
>1. mvn package
>
> Where I got the following error:
>
> BUILD FAILURE
> [INFO]
> 
> [INFO] Total time: 3.123 s
> [INFO] Finished at: 2018-07-26T08:30:10-07:00
> [INFO]
> 
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
> (default-compile) on project my-app: Compilation failure: Compilation
> failure:
> [ERROR] Source option 5 is no longer supported. Use 6 or later.
> [ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>
> My research about this error led me to this page:
>
>
> https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
>
> Now I am stuck. Where do I find these files?  Is there any more information
> to be gleaned of exactly what my edits should be?
>
> I am assuming I am doing something wrong because I would expect the Maven
> tutorial has been tested.
>
> TIA
>
> Scott
>


Problem with Maven Tutorial

2018-07-26 Thread Scott Miller
Hi,

I am trying to use Maven for the first time.  I have it installed and  was
working on this tutorial:

https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

I got to this step:


   1. mvn package

Where I got the following error:

BUILD FAILURE
[INFO]

[INFO] Total time: 3.123 s
[INFO] Finished at: 2018-07-26T08:30:10-07:00
[INFO]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
(default-compile) on project my-app: Compilation failure: Compilation
failure:
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

My research about this error led me to this page:

https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Now I am stuck. Where do I find these files?  Is there any more information
to be gleaned of exactly what my edits should be?

I am assuming I am doing something wrong because I would expect the Maven
tutorial has been tested.

TIA

Scott


Re: Announcing OSSIndex plugins for Apache Maven: Scan your dependencies for known vulnerabilities

2018-07-26 Thread Matthieu BROUILLARD
Excellent enhancement ; thank you Brian & Sonatype.

>  Report issues or ideas here:
> https://github.com/sonatype/ossindex-maven/issues

As requested I submitted my feedback as an RFE (
https://github.com/sonatype/ossindex-maven/issues/10) to report possible
fixes on the vulnerabilities.

Regards,
Matthieu

On Thu, Jul 26, 2018 at 2:55 AM Brian Fox  wrote:

> You probably know Sonatype for our work in the Maven community, Nexus
> Repository Manager, and for hosting Central. You may not know that for
> the last 7 years we've also been leading the way in solutions that
> allow developers to innovate faster and be able to improve security,
> license compliance and architecture at the same time.
>
> For years the primary domain for these concerns have been large
> enterprises and/or governance teams. We're seeing a new trend along
> with the #devsecops movement that brings concerns like the security
> posture of a 3rd party component into the forefront of concerns for
> developers. To further empower that trend, we've updated and
> relaunched OSS Index with the mission to provide information and APIs
> to the community -for free- to use in raising the security bar for
> everyone.
>
> Out of the box you can find a plugin to assess and optionally fail
> your build if components contain known vulnerabilities. If you're a
> fan of the Maven Enforcer Plugin, there's a rule for you too. I
> encourage you to check it out and if you're so inclined, grab the REST
> API and integrate it into your favorite tool.
>
> https://ossindex.sonatype.org
>
> Find the Maven Plugin docs here:
> https://sonatype.github.io/ossindex-maven/maven-plugin/
>
> Find the Enforcer Plugin usage here:
> https://sonatype.github.io/ossindex-maven/enforcer-rules/
>
> Report issues or ideas here:
> https://github.com/sonatype/ossindex-maven/issues
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>