On Sun, 18 Jul 2021 at 10:19, Gilles Sadowski <gillese...@gmail.com> wrote:
> Hi. > > Le sam. 17 juil. 2021 à 18:17, Alex Herbert <alex.d.herb...@gmail.com> a > écrit : > > > > On Sat, 17 Jul 2021 at 15:59, Alex Herbert <alex.d.herb...@gmail.com> > wrote: > > > > > > > > > > > On Sat, 17 Jul 2021 at 14:17, Gilles Sadowski <gillese...@gmail.com> > > > wrote: > > > > > >> Hi. > > >> > > >> Le mer. 14 juil. 2021 à 13:02, Alex Herbert <alex.d.herb...@gmail.com> > a > > >> écrit : > > >> > > > >> >>> [...] > > >> > > > Anyway the summary is that using 'mvn site' should not be > expected > > >> to run > > >> > > > all the validation checks on the code. It is to build > documentation. > > >> > > > > >> > > Makes sense (and we were doing it wrong before). > > >> > > > > >> > > > If you want to check the code then use 'mvn verify'. > > >> > > >> Command > > >> $ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ mvn clean verify test > > >> site > > >> currently results in the build failing: > > >> ---CUT--- > > >> [ERROR] Failed to execute goal > > >> org.apache.maven.plugins:maven-shade-plugin:3.1.1:shade (default) on > > >> project examples-sofm: Error creating shaded jar: > > >> > > >> > /home/gilles/devel/java/apache/commons-math/trunk/commons-math-neuralnet/target/classes > > >> (Is a directory) -> [Help 1] > > >> ---CUT--- > > >> > > >> Any idea? > > >> > > > > > > This works for me (have JAVA_HOME already set): > > > > > > mvn -v > > > > > > *Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)* > > > > > > Maven home: /usr/local/apache-maven-3.6.3 > > > > > > Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: > > > /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/jre > > > > > > Default locale: en_US, platform encoding: UTF-8 > > > > > > OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac" > > > > > > cd commons-math-examples/ > > > > > > touch site-content > > > > > > touch chinese-rings/site-content > > > > > > touch tsp/site-content > > > > > > mvn clean verify test site > > > > > > > > > > > Building from the project root I get the same error you reported. > > > > This post of StackOverflow [1] indicates that this is a problem with > > running the shade plugin within a multi-phase command. It is related to > > dependency resolution when the shade plugin tried to incorporate all the > > classes in the final jar. If building all the classes it the same phase > > then it appears to break. If left to download them (as in my first > example) > > then it works. > > $ mvn verify > --> SUCCESS > > $ mvn verify site > --> SUCCESS > > $ mvn verify test site > --> FAILURE > > $ mvn test package verify site > --> SUCCESS > This is inconsistent to say the least. The bug MSHADE-215 [1] appears to indicate that running 'test package' will fail and running 'package' will succeed. Anyway it may be the same thing where adding the 'test' target somewhere in the set of targets causes the shade plugin to include classes using a directory but label them as a jar. [1] https://issues.apache.org/jira/browse/MSHADE-215 > > I notice that junit runs in the "verify" phase; so, is the "test" phase > always redundant (before a commit)? > If running a target that is after 'test' in the lifecycle then yes, 'test' is redundant. If you use 'verify' you do not need 'test'. Adding 'test' appears to trigger a bug in the shade plugin using some combinations of targets later than 'test' from the default lifecycle. > > > I suggest the shaded jar is added within a profile and not on the default > > build. Thus you need to explicitly build the shaded jar. > > > > Is it the intention to release this artifact? Otherwise build on-demand > via > > a profile should solve this. > > Do you propose that the "commons-math-examples" not be part of the > official release? > Are they of value as a dependency to be used by others? If we release the standard jars from the examples modules then they can be included as a dependency and that will bring everything upstream with it to a project. The question is whether the shaded jar has value as a released artifact. I always considered them proof-of-application demos rather than programs that had far reaching utility. > > Regards, > Gilles > > > > > [1] > > > https://stackoverflow.com/questions/37942689/maven-shade-plugin-reports-error-creating-shaded-jar-target-classes-is-a-d > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >