commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <>
Subject Re: [Math] Maven profile for running the examples?
Date Wed, 07 Jan 2015 16:29:36 GMT
On 01/07/2015 04:50 PM, sebb wrote:
> On 7 January 2015 at 13:59, Gilles <> wrote:
>>>> [...]
>>> I have pushed the change to the userguide. To execute the example you do
>>> the following:
>>>  * go to commons-math folder, type mvn clean install
>>>    this step is only needed if your local maven repository does not yet
>>>    contain the latest commons-math snapshot
>>>  * go to userguide folder (src/userguide), type mvn clean package
>>>  * now you can run the examples like that:
>>> java -cp target/commons-math3-examples-uber-3.5-SNAPSHOT.jar
>>> org.apache.commons.math3.userguide.LowDiscrepancyGeneratorComparison
>> Very nice.
> Yes, however there is a caveat.
> The uber jar must not be published, at least in its current form.
> - it contains un-shaded classes that have different Maven coords (=> jar hell)
> - it does not have N&L files
> - are the 3rd party jars AL compatible?

there is no intention to publish the uber jar.

> There is another way to run the code without needing to generate the jars:
> cd src/userguide
> mvn -q exec:java
> -Dexec.mainClass=org.apache.commons.math3.userguide.LowDiscrepancyGeneratorComparison

nice, did not know this trick before.

> This uses Maven to resolve the dependencies.
> Works very well for developer testing of examples.
> However it is not so useful for end users as they would need Maven and
> the Math source.
> The NET jar method works well because there are no external
> dependencies, and the example jar is created in the same directory as
> the core jar it depends on.
> The same approach would work for Math, but the user would have to
> download the additional dependencies somehow.

the approach with exec:java is good enough imho, as >90% of the users
will have maven installed.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message