[GeoNetwork-devel] gitter workparty on maven artifact use

A couple weeks ago we wrote up the following proposal: https://github.com/geonetwork/core-geonetwork/wiki/Host-Geonetwork-artifacts-on-repo.osgeo.org-(Nexus-Artifactory-Repo)

I have been digging into what this will take :slight_smile:

The proposal covers:

  1. Updating the pom.xml repositories (which will also reduce build time)

  2. Updating the pom.xml distribution management (to publish the artifacts publicly)

In implementing this I found a surprise:

  1. Many sections of the build avoid dependencies entirely and instead copy content between directories.
  • Use of maven-resources-plugin:copy-resources to copy directories needs to be replaced with maven-dependency-plugin:unpack to copy content out of artifacts (zip or jar).
  1. For the above to work several things that are currently pom packaging will need to change to zip or jar (so that their contents are available in the maven repository to download and unpack.
  1. The build server is deploying releases / snapshots

  2. We can test when this activity is completed the transition to artifacts by starting wot empty local maven repository cd into any geonetwork folder and build.

As I do not have commit access this is going to be difficult to do via careful individual PRs. I would like to ask for a small work party (on gitter?) explore these topics, make the changes to master, and try them out locally and on the build server.

···

–
Jody Garnett

I would like to report some progress.

I have been keeping the proposal up to date to reflect state of work, I know that does not directly reflect what was reviewed/approved but it is good to have a summary of activities.

  1. Updating the pom.xml repositories
  • this did not go completely smoothly, some odd dependencies from core-maven-repo are available no where else…
  • some like globes are somehow invalid and nexus refuses to let me upload them!
  • rather than be blocked I setup geonetwork-cache as a temporary measure which will lazily pull from core-maven-repo
  • a side benefit is you can visit the above url and see only the third-party jars we are responsible for
  1. Updating the pom.xml distribution management
···

Jody Garnett

Thanks to Juan and Jose for discussion, review and testing, with these changes I have been able to deploy SNAPSHOTS from master https://repo.osgeo.org/repository/geonetwork-snapshots/

There is one question for Francois and/or Florent:

  • Core includes a org.mapfish.print print-lib dependency, with a number of exclusions to prevent conflict with things like spring-framework and guava.

  • Web also includes this dependency, but does not provide any exclusions!

Q: Is this an oversight? Can the same exclusions be applied to reduce chance of conflict?

···

–
Jody Garnett

The second interesting change is now ready: Use unpack to support use of schema plugins as artifacts

While the link above has background on approach taken, reviewers may wish to start with reading updated schemas/README.md instructions.

This requires iso19115-3.2018 pull request #66 which also provides a good example how plugins can package their content:

src/main/config/translations META-INF/catalog/locales src/main/resources **** **src/main/plugin** **plugin** ****
···

–
Jody Garnett