Re: [Help] Force maven[-surefire] to run in parallel

2017-03-15 Thread Thomas Broyer
Hi,

On Wed, Mar 15, 2017 at 2:11 PM Luis Henrique de Souza Melo <
l...@cin.ufpe.br> wrote:

> Hi,
>
> I am a student at the Federal University of Pernambuco, and our group is
> having some issues with Maven to run some tests in a huge amount of
> projects.
>
> We plan to run all theses open-source projects tests in parallel and in
> sequential using its own maven. However, we cannot change every pom.xml
> from every module and/or project main pom.xml manually.
>
> Is there any way to force maven and/or surefire to run in parallel using a
> command line argument, like: mvn test --parallel 3 -fae
> Or even in sequential mode would help us like: mvn test --sequential -fae
>

All parallelism-related properties can be set using "user properties",
which means you can set them from the command line (if they haven't been
set explicitly in the POMs); e.g. for forkCount [1] you can call Maven as
"mvn -DforkCount=2 test" to set the forkCount property to 2. If the
properties have been set in the POM, if they have been set using a property
value (e.g. ${some.property}) then you can override
the property from the command line (i.e. "mvn -Dsome.property=2 test"). If
the properties have been set with hard-coded values (e.g.
1) then you have no other choice than to edit the
POMs.

And then you can tell Maven to parallelize the build with -T.

Actually, everything seems to be described in the Surefire documentation [2]

[1]
https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkCount

[2]
https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html


Re: [Help] Force maven[-surefire] to run in parallel

2017-03-15 Thread Charles Honton
You should consider that if the project’s tests were not written with 
multi-threading in mind, they may fail.

> On Mar 15, 2017, at 6:56 AM, Thomas Broyer  wrote:
> 
> Hi,
> 
> On Wed, Mar 15, 2017 at 2:11 PM Luis Henrique de Souza Melo <
> l...@cin.ufpe.br> wrote:
> 
>> Hi,
>> 
>> I am a student at the Federal University of Pernambuco, and our group is
>> having some issues with Maven to run some tests in a huge amount of
>> projects.
>> 
>> We plan to run all theses open-source projects tests in parallel and in
>> sequential using its own maven. However, we cannot change every pom.xml
>> from every module and/or project main pom.xml manually.
>> 
>> Is there any way to force maven and/or surefire to run in parallel using a
>> command line argument, like: mvn test --parallel 3 -fae
>> Or even in sequential mode would help us like: mvn test --sequential -fae
>> 
> 
> All parallelism-related properties can be set using "user properties",
> which means you can set them from the command line (if they haven't been
> set explicitly in the POMs); e.g. for forkCount [1] you can call Maven as
> "mvn -DforkCount=2 test" to set the forkCount property to 2. If the
> properties have been set in the POM, if they have been set using a property
> value (e.g. ${some.property}) then you can override
> the property from the command line (i.e. "mvn -Dsome.property=2 test"). If
> the properties have been set with hard-coded values (e.g.
> 1) then you have no other choice than to edit the
> POMs.
> 
> And then you can tell Maven to parallelize the build with -T.
> 
> Actually, everything seems to be described in the Surefire documentation [2]
> 
> [1]
> https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkCount
> 
> [2]
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html


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



Re: [Help] Force maven[-surefire] to run in parallel

2017-03-15 Thread Luis Henrique de Souza Melo
@Thomas Broyer
Thanks, we will try to run with these args and ignore those who does not
behave like expected...

In parallel, we are still looking for other alternatives if there is any.

@Charles Honton
Thanks for this information.
I am considering that.

Em qua, 15 de mar de 2017 às 11:15, Charles Honton 
escreveu:

You should consider that if the project’s tests were not written with
multi-threading in mind, they may fail.

> On Mar 15, 2017, at 6:56 AM, Thomas Broyer  wrote:
>
> Hi,
>
> On Wed, Mar 15, 2017 at 2:11 PM Luis Henrique de Souza Melo <
> l...@cin.ufpe.br> wrote:
>
>> Hi,
>>
>> I am a student at the Federal University of Pernambuco, and our group is
>> having some issues with Maven to run some tests in a huge amount of
>> projects.
>>
>> We plan to run all theses open-source projects tests in parallel and in
>> sequential using its own maven. However, we cannot change every pom.xml
>> from every module and/or project main pom.xml manually.
>>
>> Is there any way to force maven and/or surefire to run in parallel using
a
>> command line argument, like: mvn test --parallel 3 -fae
>> Or even in sequential mode would help us like: mvn test --sequential -fae
>>
>
> All parallelism-related properties can be set using "user properties",
> which means you can set them from the command line (if they haven't been
> set explicitly in the POMs); e.g. for forkCount [1] you can call Maven as
> "mvn -DforkCount=2 test" to set the forkCount property to 2. If the
> properties have been set in the POM, if they have been set using a
property
> value (e.g. ${some.property}) then you can override
> the property from the command line (i.e. "mvn -Dsome.property=2 test"). If
> the properties have been set with hard-coded values (e.g.
> 1) then you have no other choice than to edit the
> POMs.
>
> And then you can tell Maven to parallelize the build with -T.
>
> Actually, everything seems to be described in the Surefire documentation
[2]
>
> [1]
>
https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkCount
>
> [2]
>
https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html


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


[Help] Force maven[-surefire] to run in parallel

2017-03-15 Thread Luis Henrique de Souza Melo
Hi,

I am a student at the Federal University of Pernambuco, and our group is
having some issues with Maven to run some tests in a huge amount of
projects.

We plan to run all theses open-source projects tests in parallel and in
sequential using its own maven. However, we cannot change every pom.xml
from every module and/or project main pom.xml manually.

Is there any way to force maven and/or surefire to run in parallel using a
command line argument, like: mvn test --parallel 3 -fae
Or even in sequential mode would help us like: mvn test --sequential -fae


Maven Shade Plugin - How to Shade

2017-03-15 Thread Manish Maheshwari
Hi,

Quick help - This is the first time i am using the shade plugin. I saw the
shading documentation here -  but could not figure out which transformer
should I use -
https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html

My requirement is this - I am using Apache Spark 1.6 that has a dependency
on JPMML 1.1.15 as documented here -
https://repository.cloudera.com/artifactory/cloudera-repos/org/apache/spark/spark-mllib_2.10/1.6.0-cdh5.7.5-SNAPSHOT/spark-mllib_2.10-1.6.0-cdh5.7.5-20161028.092134-21.pom


  org.jpmml
*  pmml-model*
*  1.1.15*
  compile
  

  FastInfoset
  com.sun.xml.fastinfoset


  istack-commons-runtime
  com.sun.istack

  


My code uses org.jpmml version 1.2.6

org.jpmml
pmml-model
1.2.6



Now my shade pom snippet looks like -

org.apache.maven.plugins
maven-shade-plugin
2.4.1


package

shade




org.jpmml

my.spark.jpmml










But this does not work as intended and my package fails. Any idea what is
missing here.

Thanks,
Manish


Maven Resolver question re: local repo and mirrors

2017-03-15 Thread Laird Nelson
Hello; I'm putting together a client, I guess, of the Maven Artifact
Resolver APIs (https://maven.apache.org/resolver/maven-resolver-api/).

I am trying to make my client be as Maven-like as possible.  So I'm using,
among other things, MavenRepositorySystemUtils.  I can, of course, go into
more details if needed; this is intended to be a shorthand that says I
mostly know what I'm doing.  :-)

(Another way to put this is I am following recipes you can find here (
https://github.com/eclipse/aether-demo/tree/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples),
bearing in mind that Aether has of course become maven-resolver
,
so obviously there are a few tweaks here and there.)

I understand most of this, but is there a component I can use that includes
the automagic usage of mirrors etc. from a Maven ~/.m2/settings.xml file?
My sense is if I just do:

final LocalRepository localRepository = new
LocalRepository("target/local-repository");
final LocalRepositoryManager localRepositoryManager =
repositorySystem.newLocalRepositoryManager(repositorySystemSession,
localRepository);
repositorySystemSession.setLocalRepositoryManager(localRepositoryManager);

…and:

final RemoteRepository mavenCentral = new
RemoteRepository.Builder("central", "default", "
http://central.maven.org/maven2/;).build();
// now use this and localRepository in a CollectRequest or the like

…I'm not getting the (useful) magic of a Maven settings.xml file.  I
wouldn't really expect to, either, since this is just usage of the
project-formerly-known-as-Aether, not some deep Maven integration.

What is the recipe to include this as well?  I had a brief look in Maven
core—think an explorer encountering a dark ominous cave with a flaming
torch running out of fuel, backing away slowly—but wasn't sure where to
look.

Best,
Laird