On Tue, 18 Jan 2022 at 15:47, Gilles Sadowski <[email protected]> wrote:

<!-- SNIP -->

> Build is fine in [RNG].
>
> >
> > So this is a documentation issue. On the next release of a
> > multi-module project (e.g. Numbers) the section can be altered to
> > state what is expected to be performed by the release plugin. The
> > manual steps to do the same thing may not work and can be removed if
> > they are invalid. However they may work if 'mvn package' has been run
> > before the 'assembly:single' goal (I've not checked).
>
> The maven configuration in [Math] is somehow broken.
>
> When running
>   $ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ mvn
> -Duser.name="erans" -Dcommons.release.dryRun=true -Ptest-deploy
> -Prelease clean package site deploy
> the build is successful (when all "randomized" unit tests have passed).
> [But the "Prelease" switch did not seem to trigger anything
> related to "dist-archive".]

There is no release profile in the [Math] or [Numbers] pom. There is
in [RNG] and [Geometry]. Look for <id>release</id>.

In geometry the release profile includes the examples module only. In
RNG it includes the dist-archive module. So the command you listed
would not work for any project apart from RNG. I've not released any
of the other multi-module projects. Matt performed the last release of
Numbers and Geometry so maybe there is something missing from the
documented steps. Somehow he got it to work with a parent pom that
does not include the dist-archive module.

I think these multi-module projects now build the site separately
(because it includes the examples) and then stage them manually using
svn commands. So an actual release can just run the package goal from
the top level directory and then this from the dist-archive directory:

mvn -Duser.name="erans" -Dcommons.release.dryRun=true -Ptest-deploy
-Prelease deploy

i.e. only the deploy goal. This should then pick up all the packages
from the other modules and copy them somewhere local in a dry run of
deploying them to nexus and the commons dev dist area (for the binary
distributions).

I did update the parent pom to have a release profile. I then found
that the dist-archive module pom did not have the correct artifact
Ids. They should have math4 in the name:

commons-math-legacy-exception -> commons-math4-legacy-exception

I've corrected this.

> However, the above command unexpectedly created/modified files

Not sure how that happened. I tried to reproduce on my machine but did
not have spurious files when I build without the site and skipped the
tests:

mvn -Duser.name=aherbert -Dcommons.release.dryRun=true -Ptest-deploy
-Prelease clean package deploy -DskipTests

Note: I have JAVA_HOME set in my environment. When all the modules
have built their packages I can then run the following to get the
distribution archives:

cd dist-archive && mvn assembly:single

However I still get an issue with the full dry run when I added the
dist-archive to a release profile. It fails with this message in the
dist-archive module:

[ERROR] Failed to execute goal
org.apache.commons:commons-release-plugin:1.7:detach-distributions
(detatch-distributions) on project
commons-math: Execution detatch-distributions of goal
org.apache.commons:commons-release-plugin:1.7:detach-distributions
failed.: UnsupportedOperationException -> [Help 1]

I am not sure what is happening here. Running with -X does not provide
any useful error information. I do not know what the
detach-distributions goal is trying to do.

I tried again adding 'site site:stage' to check if this is required
and got the same error. However this time I had the modified pom files
as you described. So something in the site target is running for the
sofm module that overwrites the pom files as you previously listed.

When building the site I noted that the pom requires the fix to not do
the svn checkout of the site. So I added this too.

So there are 2 issues:

1. The release dry run cannot complete as it fails on detach-distributions.
2. The site build of sofm module overrwrites some pom files

I have not verified if issue 2 only occurs during a release dry run.

Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to