[
https://issues.apache.org/jira/browse/GEOMETRY-56?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17055902#comment-17055902
]
Alex Herbert commented on GEOMETRY-56:
--------------------------------------
I tried your dist archive and get the same error as you describe.
The strange thing is that the when you have a look in the {{target/deploy}}
directory the jars are all there.
You only posted a snippet of the error. A bit further on there is the standard
blurb from maven about how to repeat the command from the same place using the
resume from flag:
{noformat}
mvn -Duser.name=aherbert -Dcommons.release.dryRun=true -Ptest-deploy -Prelease
clean test package site deploy -rf :commons-geometry
{noformat}
If you do this then it works. So given the packages are there it completes as
expected.
What it happening is that the packages are not there when a specific maven goal
needs them because part of the build has been forked (and is not yet completed).
I solved this for RNG by downgrading the JXR plugin. When building the site the
JXR plugin renders all the cross linked source code that other plugins can use
to show the lines which contain errors (e.g. PMD, Checkstyle, etc). So it's not
critical and only comes into play when using the {{site}} lifecycle target.
I modified the top level pom.xml with this:
{noformat}
<!-- Fix to avoid JXR 3.0.0 forking the lifecycle phase during site report
jxr:aggregate. If forked the dist-archive modules fails as it depends on
the packages from other modules. -->
<commons.jxr.version>2.5</commons.jxr.version>
{noformat}
This seems to fix the issue. Try it on your machine.
There may be a better way to do this. But a search on the web shows that
plugins that fork is a recurrent problem and forked builds are best avoided.
Most plugins make this optional but JXR does not.
One thing I did notice is that after you try and use the dist-archive module
you then cannot then run {{mvn clean}} as checkstyle complains about the sha512
properties file.
{noformat}
[INFO] There is 1 error reported by Checkstyle 8.29 with
/home/ah403/git/commons-geometry/src/main/resources/checkstyle/checkstyle.xml
ruleset.
[ERROR] dist-archive/target/commons-release-plugin/sha512.properties:[1]
(header) Header: Missing a header - not enough lines in file.
{noformat}
You can fix this by either adding this file to a list of exclusions for
checkstyle and/or changing checkstyle to not bind to the validate phase. This
seems to execute before clean even though it is not listed in the [Maven
lifecylce
reference|https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference].
In [numbers] we dropped the following lines from the pom for the checkstyle
plugin:
{noformat}
<id>validate</id>
<phase>validate</phase>
{noformat}
It allows you to run {{mvn test}} with checkstyle violations as the default
phase is verify (which is after test). It allows you to put System.out.println
all over your code for testing without having to workaround checkstyle
exclusions. It also in this case allows you to clean your project which has
unlicensed properties file in the target directory.
> Create distribution archive
> ---------------------------
>
> Key: GEOMETRY-56
> URL: https://issues.apache.org/jira/browse/GEOMETRY-56
> Project: Apache Commons Geometry
> Issue Type: Improvement
> Reporter: Karl Heinz Marbaise
> Assignee: Karl Heinz Marbaise
> Priority: Blocker
> Labels: Maven, jenkins, pull-request-available
> Fix For: 1.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> *Problem*
> * Currently the configuration for building a distribution archive does not
> exist
> * The current configuration for creating archives is wrong
> *Goal*
> * Create separate distribution archive module
> * Create correct configuration for maven-assembly-plugin
--
This message was sent by Atlassian Jira
(v8.3.4#803005)