Giter VIP home page Giter VIP logo

maven-repository-tools's Introduction

simpligility technologies inc. presents

Maven Repository Tools

Introduction

A collection of tools to work with Maven repositories.

Maven Repository Provisioner

a command line tool and library to provision a component and all its transitive dependencies from a source Maven repository to a target Maven repository. See more in the readme file of the module.

Repository Provisioner Maven Plugin

a maven plugin for the same task - to be done.

Requirememts

All tools require Java 11 or higher.

Download

Everything is available from the Central Repository in the simpligility space:

Roadmap, Issues, Changes

Check out the issues list for upcoming changes, existing problems and so on.

For past releases and already implemented changes, see the changelog as well as the commit history.

License

Eclipse Public License - v 1.0

For full text see the LICENSE file or https://www.eclipse.org/legal/epl-v10.html

Building

Run

mvn clean install

Verify full build for release with

mvn clean deploy -P release

Release with the usual

mvn release:prepare release:perform

Contributions

are very welcome. Send a pull request or report issues on GitHub. Even just a spelling fix in the readme or anything else really is a welcome help.

Contributors

maven-repository-tools's People

Contributors

boulik avatar cstamas avatar dgeissl avatar drasrax avatar mosabua avatar pnrgitter avatar sellersj avatar whittlec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maven-repository-tools's Issues

When uploading, include maven-metadata.xml

I'm currently trying to migrate my old maven repo to my new nexus repo, but when uploading it from local cache (using -cd) all artifacts get uploaded just fine. But no maven-metadata.xml is uploaded.

Also a quick question, can I delete the md5 and sha1 checksum files before I upload?

Error when migrating from Nexus 2 FS repo

There is an issue when using maven-repository-provisioner:1.2.1 to migrate from filesystem inside Nexus2 repository directory.

Using this command:

java -jar maven-repository-provisioner-*-jar-with-dependencies.jar \
     -cd "/sonatype-work/storage/releases" \
     -t "http://nexus3.company.com/repository/maven-releases" \
     -u admin -p admin123

Full log:

Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: http://nexus3.company.com/repository/maven-releases/
Username: admin
Password: ************************
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
Check target: true
Verify only: false
Local cache or source repository directory: /sonatype-work/storage/releases


09:25:01.121 [main] INFO  MavenRepositoryProvisioner -  Absolute path: /sonatype-work/storage/releases
09:25:01.123 [main] INFO  MavenRepositoryProvisioner - Detected local cache directory '/sonatype-work/storage/releases'.
09:25:01.124 [main] INFO  MavenRepositoryProvisioner - No artifact coordinates specified - using cache directory as source.
09:25:01.126 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval skipped.
09:25:01.127 [main] INFO  MavenRepositoryProvisioner - Artifact deployment starting.
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(String.java:1967)
	at com.simpligility.maven.GavUtil.getGavFromRepositoryPath(GavUtil.java:18)
	at com.simpligility.maven.provisioner.MavenRepositoryDeployer.deployToRemote(MavenRepositoryDeployer.java:140)
	at com.simpligility.maven.provisioner.MavenRepositoryProvisioner.main(MavenRepositoryProvisioner.java:120)

Content of source directory:

root@nexus-654873208-1546f nexus]# ls -la /sonatype-work/storage/releases
total 36
drwxr-xr-x  6 root root 4096 Dec 15 07:16 .
drwxrwxrwx 26 root root 4096 Jul  3 14:36 ..
drwxr-xr-x  2 root root 4096 Dec 14 17:12 .index
drwxr-xr-x  2 root root 4096 Dec 15 07:16 .meta
drwxr-xr-x  5 root root 4096 Jul  5 12:41 .nexus
-rw-r--r--  1 root root   25 Dec 15 07:16 archetype-catalog.xml
-rw-r--r--  1 root root   32 Jul  5 12:42 archetype-catalog.xml.md5
-rw-r--r--  1 root root   40 Jul  5 12:42 archetype-catalog.xml.sha1
drwxr-xr-x  3 root root 4096 May  3  2017 com

Is it possible to migrate a wohle repository (without -a parameter)?

Hi,

I am trying your tool to migrate a repository from my old nexus (2.X) server to a new one (3.Y). I want to migrate a whole repository, not only a singe artifact.

I was able to transfer single artifacts with the following call:

java -jar /tmp/maven-repository-provisioner-1.4.1-jar-with-dependencies.jar \
	-s "http://nexus2.domain.com/nexus/content/repositories/snapshots/" \
	${N2CREDS} \
	-t "https://nexus3.domain.com/repository/snapshots/" \
	${N3CREDS} \
	-a "de.example:my-app:0.0.1-SNAPSHOT"

But what I really want to do is transferring the whole repository with everything insinde, like that:

java -jar /tmp/maven-repository-provisioner-1.4.1-jar-with-dependencies.jar \
	-s "http://nexus2.domain.com/nexus/content/repositories/snapshots/" \
	${N2CREDS} \
	-t "https://nexus3.domain.com/repository/snapshots/" \
	${N3CREDS}"

But then, nothing happens, I only get a SUCCESS returncode but no artifacts are transferred.
Any ideas?
Or is it not possible to use your tool like this?

Kind regrads

Some minor improvements

Nice work, very useful.
Sorry, cant easily create a pull just now, so Ive added a 2 patches below.

  1. adds support for zip files in migration, needed for angular repos.
diff --git a/maven-repository-provisioner/src/main/java/com/simpligility/maven/MavenConstants.java b/maven-repository-provisioner/src/main/java/com/simpligility/maven/MavenConstants.java
index 2e00cd6..3b512ee 100644
--- a/maven-repository-provisioner/src/main/java/com/simpligility/maven/MavenConstants.java
+++ b/maven-repository-provisioner/src/main/java/com/simpligility/maven/MavenConstants.java
@@ -12,6 +12,7 @@
     public static final String HPI = "hpi";
     public static final String JPI = "jpi";
     public static final String AAR = "aar";
+    public static final String ZIP = "zip";
 
     // packaging types with no file of the same extension, instead normal jar is the main file
     public static final String JAR = "jar";
@@ -45,7 +46,8 @@
       boolean result = false;
       if ( HPI.equals( packaging )
           || JPI.equals( packaging )
-          || AAR.equals( packaging ) )
+          || AAR.equals( packaging )
+          || ZIP.equals( packaging ))
       {
         result = true;
       }
  1. returns without throwing Nullpointer exception when a resource is not found. This means you can migrate 99% of the repo without failing, then manually sort out the offending items.
diff --git a/maven-repository-provisioner/src/main/java/com/simpligility/maven/provisioner/ArtifactRetriever.java b/maven-repository-provisioner/src/main/java/com/simpligility/maven/provisioner/ArtifactRetriever.java
index 41f7009..c0827a7 100644
--- a/maven-repository-provisioner/src/main/java/com/simpligility/maven/provisioner/ArtifactRetriever.java
+++ b/maven-repository-provisioner/src/main/java/com/simpligility/maven/provisioner/ArtifactRetriever.java
@@ -237,6 +237,7 @@
             catch ( Exception e )
             {
                 logger.info( "Failed to retrieve gav from " + pomFile.getAbsolutePath() );
+                return;
             }
             String packaging = gav.getPackaging();

StringIndexOutOfBoundsException with scm provider jar

org.apache.maven.scm:maven-scm-provider-clearcase:jar:1.9.2

09:30:44.569 [main] INFO LoggingRepositoryListener - Resolved artifact org.apache.maven.scm:maven-scm-api:jar:javadoc:1
.9.2 from central (, default, releases+snaps
hots)
09:30:44.569 [main] INFO ArtifactRetriever - Retrieved c:\tools\maven-repository-provisioner\local-repo\org\apache\mave
n\scm\maven-scm-api\1.9.2\maven-scm-api-1.9.2-javadoc.jar
09:30:44.569 [main] INFO LoggingRepositoryListener - Resolving artifact org.codehaus.plexus:plexus-utils:jar:javadoc:3.
0.15
09:30:44.569 [main] INFO LoggingRepositoryListener - Resolved artifact org.codehaus.plexus:plexus-utils:jar:javadoc:3.0
.15 from central ( default, releases+snapsh
ots)
09:30:44.569 [main] INFO ArtifactRetriever - Retrieved c:\tools\maven-repository-provisioner\local-repo\org\codehaus\pl
exus\plexus-utils\3.0.15\plexus-utils-3.0.15-javadoc.jar
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1911)
at com.simpligility.maven.provisioner.GavUtil.getGavFromRepositoryPath(GavUtil.java:11)
at com.simpligility.maven.provisioner.MavenRepositoryHelper.deployToRemote(MavenRepositoryHelper.java:61)
at com.simpligility.maven.provisioner.MavenRepositoryProvisioner.main(MavenRepositoryProvisioner.java:64)

Don't include md5 or sha1 when migrating from FS

Hi,
When migrating a Nexus2 repository (from sonatype-work/storage/my-repo directory) to a new Nexus3, the script complains about checksum files

WARN  o.e.a.c.b.BasicRepositoryConnector - Failed to upload checksum groupId/artifactId/1.0.0/artifactId-1.0.0-classifier.ext.md5.sha1: Server Error (500)
WARN  o.e.a.c.b.BasicRepositoryConnector - Failed to upload checksum groupId/artifactId/1.0.0/artifactId-1.0.0-classifier.ext.md5.md5: Server Error (500)

BTW, thx a lot for this such convenient tool !

Support to get everything from repo

It would be nice to get whatever is there in the remote repo for a specific GAV .. e.g. all the classifier based additional artifacts like -test, -test-source, -jar-with-dependencies and so on.

This might be hard or impossible to implement properly. It would probably require some sort of protocol to the remote server to see whats available. E.g. it could be a HTML directory listing that is scraped or a proper API. And would be different for different source repositories... so lots of work potentially. Not sure if this is needed at this stage.

Pom transfer problem

Could not transfer artifact org.apache.maven:maven-plugin-parameter-documenter:pom:2.2.1

when using e.g. com.simpligility.maven:progressive-organization-pom:pom:2.3.0 .

Password in log is not masked

Need to replace it with a masked string e.g. so that when the logs are kept as part of a CI server run they dont reveal the password of the user executing a parameterized job with it.

Summary report

Track all component GAVs that got resolved succesfully and create a list for a report at the end of the run.

Then also track all components that get deployed and the ones where deployment failed. Failure probably means it was already there..

Success reported even if repository provisioner is unable to retrieve artifact

If the repository provisioner is unable to retrieve the requested artifact from the source repo, it incorrectly returns a success exit code.
In MavenRepositoryProvisioner.java the reportResults() method first checks for a retrieval failure and correctly sets the value of "provisioningSuccess". It then checks for a deployment failure; if nothing was retrieved, deployment never executes, and as a result never fails, so no deployment failure is reported. At this point, the value of "provisioningSuccess" is overwritten by the "success" code from the (non-)deployment, which causes the utility to return 0 (Success) despite its failure to read from the source repository (it does log the failed retrieval to the console, however).
This is a problem when using the repository provisioner to automatically copy several files between repos inside an unattended app which needs to respond appropriately to a failure.

migrating repository without failing on missing dependency

Hello,

I have to migrate two very old repositories in a new nexus 3.6.
The thing is I do not want to upload all the dependencies in the new repository but only the one of my company.

Basically migrating only the release repository of the old one into the release repository of the new one.
The option I see are the following:

  • add a filter mechanism on the upload part
  • add a boolean parameter to not fail if a dependency is missing in the original repository
  • add a filter in the download part, only downloading when group id starts with ...

What would be the easiest solution to put in place? And could you point me on to where I should look to make it?

Thanks,
Nicolas.

ProxyHelper does neither respect URL nor variable *.nonProxyHosts

As a user, I want to upload a maven artifact from a public repository to an internal repository when located behind a proxy. Currently this is not possible because ProxyHelper will either always or never be used when connecting to a service.

The solution is to respect the environment variable *.nonProxyHosts in order to allow for direct access to a server (i.e. without proxy).

Wrong classpath entry in manifest

Hi,

when generating the maven-repository-provisioner-*-jar-with-dependencies.jar you add the classpath of all dependencies to the manifest, but this is wrong. Either you use the dependency plugin to collect all jars - then the classpath entry in the manifest must match the (relative) location to this collection - or you drop the classpath entry, since you currently merge all classes together in one big jar.

Cheers,
Jรถrg

Migration of snapshot repository successfull without transfering any artifact

I try to migrate a maven2 release and snapshot repository using v.1.3.1. The migration for the release repository works fine:

D:\TOOLS>java -jar maven-repository-provisioner-1.3.1-jar-with-dependencies.jar -cd "D:\NEXUS_WORK\storage\Releases" -t "https://nexus3/repository/releases/"
07:57:32.484 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
07:57:32.487 [main] INFO  MavenRepositoryProvisioner -  Maven Repository Provisioner
07:57:32.488 [main] INFO  MavenRepositoryProvisioner -  simpligility technologies inc.
07:57:32.489 [main] INFO  MavenRepositoryProvisioner -  http://www.simpligility.com
07:57:32.489 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
07:57:32.521 [main] INFO  MavenRepositoryProvisioner -
Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: https://nexus3/repository/Releases/
Username: null
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
IncludeRuntimeScope: false
Check target: true
Verify only: false
Local cache or source repository directory: D:\NEXUS_WORK\storage\Releases


07:57:32.524 [main] INFO  MavenRepositoryProvisioner -  Absolute path: D:\NEXUS_WORK\storage\Releases
07:57:32.525 [main] INFO  MavenRepositoryProvisioner - Detected local cache directory 'D:\NEXUS_WORK\storage\Releases'.
07:57:32.525 [main] INFO  MavenRepositoryProvisioner - No artifact coordinates specified - using cache directory as source.
07:57:32.526 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval skipped.
07:57:32.526 [main] INFO  MavenRepositoryProvisioner - Artifact deployment starting.
07:58:11.878 [main] INFO  LoggingTransferListener - Uploading: https://nexus3/repository/Releases/ch/axon/axon-webservice/1.0.2/axon-webservice-1.0.2-ALL.zip
....

Whereas the migration from snapshot repository just finish without transferring any artifact

D:\TOOLS>java -jar maven-repository-provisioner-1.3.1-jar-with-dependencies.jar -cd "D:\NEXUS_WORK\storage\Snapshots" -t
 "https://nexus3/repository/snapshots/"
08:01:06.140 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
08:01:06.143 [main] INFO  MavenRepositoryProvisioner -  Maven Repository Provisioner
08:01:06.144 [main] INFO  MavenRepositoryProvisioner -  simpligility technologies inc.
08:01:06.145 [main] INFO  MavenRepositoryProvisioner -  http://www.simpligility.com
08:01:06.145 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
08:01:06.177 [main] INFO  MavenRepositoryProvisioner -
Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: https://nexus3/repository/snapshots/
Username: null
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
IncludeRuntimeScope: false
Check target: true
Verify only: false
Local cache or source repository directory: D:\NEXUS_WORK\storage\Snapshots


08:01:06.183 [main] INFO  MavenRepositoryProvisioner -  Absolute path: D:\NEXUS_WORK\storage\Snapshots
08:01:06.183 [main] INFO  MavenRepositoryProvisioner - Detected local cache directory 'D:\NEXUS_WORK\storage\Snapshots'.
08:01:06.184 [main] INFO  MavenRepositoryProvisioner - No artifact coordinates specified - using cache directory as source.
08:01:06.185 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval skipped.
08:01:06.185 [main] INFO  MavenRepositoryProvisioner - Artifact deployment starting.
08:01:42.709 [main] INFO  MavenRepositoryProvisioner - Artifact deployment completed.
08:01:42.710 [main] INFO  MavenRepositoryProvisioner - Processing Completed.
08:01:42.710 [main] INFO  MavenRepositoryProvisioner -
Processing Summary
-----------------------------------
Configuration:

Provisioning artifacts: null
Source: https://repo1.maven.org/maven2
Target: https://nexus3/repository/snapshots/
Username: null
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: false
IncludeTestScope: false
IncludeRuntimeScope: false
Check target: true
Verify only: false
Local cache or source repository directory: D:\NEXUS_WORK\storage\Snapshots

Sucessful Deployments:


Failed Deployments:


Skipped Deployments (POM already in target):


Potential Deployments :



08:01:42.717 [main] INFO  MavenRepositoryProvisioner - Exiting: SUCCESS
Deployment completed successfully.

There is no error message. Any clue what the reason for this could be?

Nexus 2: 2.14.1-01
Nexus 3: 3.13.0-01

Failed to fetch classifier & extensions

Hi,

Aside our traditional jars, we also publish files using zip extension and static classifier from maven assembly.

java -jar  maven-repository-provisioner-1.3.1-jar-with-dependencies.jar -it true -ip true -ij true -ir true -is true -a "net.bigcorp.thirdparty:product-catalog:zip:static:1.296" -su deployment -sp [REDACTED] -s "https://repository.admin.bigcorp.net/repository/releases" -t "https://nexus.bigcorp.net/repository/releases" -u deployment -p [REDACTED]
16:05:41.204 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
16:05:41.206 [main] INFO  MavenRepositoryProvisioner -  Maven Repository Provisioner
16:05:41.206 [main] INFO  MavenRepositoryProvisioner -  simpligility technologies inc.
16:05:41.207 [main] INFO  MavenRepositoryProvisioner -  http://www.simpligility.com
16:05:41.207 [main] INFO  MavenRepositoryProvisioner - -----------------------------------
16:05:41.249 [main] INFO  MavenRepositoryProvisioner -
Provisioning artifacts: net.bigcorp.thirdparty:product-catalog:zip:static:1.296
Source: https://repository.admin.bigcorp.net/repository/releases
Target: https://nexus.bigcorp.net/repository/releases/
Username: deployment
Password: ***************************************
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: true
IncludeTestScope: true
IncludeRuntimeScope: true
Check target: true
Verify only: false
Local cache or source repository directory: local-cache


16:05:41.249 [main] INFO  MavenRepositoryProvisioner -  Absolute path: /Users/nsteinmetz/Documents/Clients/bigcorp/bigcorp-ops/ansible/roles/LF.nexus/files/local-cache
16:05:41.249 [main] INFO  MavenRepositoryProvisioner - Detected local cache directory 'local-cache'.
16:05:41.249 [main] INFO  MavenRepositoryProvisioner - Artifact coordinates specified - removing stale cache directory from prior execution.
16:05:41.277 [main] INFO  MavenRepositoryProvisioner - local-cache deleted.
16:05:41.317 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval starting.
16:05:41.597 [main] INFO  LoggingRepositoryListener - Resolving artifact net.bigcorp.thirdparty:product-catalog:pom:1.296
16:05:41.600 [main] INFO  LoggingRepositoryListener - Downloading artifact net.bigcorp.thirdparty:product-catalog:pom:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.008 [main] INFO  LoggingTransferListener - Downloading: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296.pom
16:05:42.267 [main] INFO  LoggingTransferListener - Downloaded: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296.pom (4 KB at 14.9 KB/sec)
16:05:42.280 [main] INFO  LoggingRepositoryListener - Downloaded artifact net.bigcorp.thirdparty:product-catalog:pom:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.281 [main] INFO  LoggingRepositoryListener - Resolved artifact net.bigcorp.thirdparty:product-catalog:pom:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.322 [main] INFO  LoggingRepositoryListener - Resolving artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT
16:05:42.324 [main] INFO  LoggingRepositoryListener - Resolving metadata net.bigcorp.thirdparty:product-catalog-parent:3.1-SNAPSHOT/maven-metadata.xml from /Users/nsteinmetz/Documents/Clients/bigcorp/bigcorp-ops/ansible/roles/LF.nexus/files/local-cache (enhanced)
16:05:42.325 [main] INFO  LoggingRepositoryListener - Resolved metadata net.bigcorp.thirdparty:product-catalog-parent:3.1-SNAPSHOT/maven-metadata.xml from /Users/nsteinmetz/Documents/Clients/bigcorp/bigcorp-ops/ansible/roles/LF.nexus/files/local-cache (enhanced)
16:05:42.371 [main] INFO  LoggingRepositoryListener - Resolving metadata net.bigcorp.thirdparty:product-catalog-parent:3.1-SNAPSHOT/maven-metadata.xml from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.381 [main] INFO  LoggingTransferListener - Downloading: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog-parent/3.1-SNAPSHOT/maven-metadata.xml
16:05:42.525 [main] INFO  LoggingRepositoryListener - Resolved metadata net.bigcorp.thirdparty:product-catalog-parent:3.1-SNAPSHOT/maven-metadata.xml from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.525 [main] INFO  LoggingRepositoryListener - Downloading artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.527 [main] INFO  LoggingTransferListener - Downloading: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog-parent/3.1-SNAPSHOT/product-catalog-parent-3.1-SNAPSHOT.pom
16:05:42.649 [main] INFO  LoggingTransferListener - Could not transfer artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from/to central (https://repository.admin.bigcorp.net/repository/releases): Bad Request (400)
16:05:42.650 [main] INFO  LoggingRepositoryListener - Downloaded artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.652 [main] INFO  LoggingRepositoryListener - Resolved artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from null
16:05:42.656 [main] INFO  ArtifactRetriever - DependencyResolutionException
org.eclipse.aether.resolution.DependencyResolutionException: Failed to read artifact descriptor for net.bigcorp.thirdparty:product-catalog:zip:static:1.296
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:351)
        at com.simpligility.maven.provisioner.ArtifactRetriever.getArtifactResults(ArtifactRetriever.java:165)
        at com.simpligility.maven.provisioner.ArtifactRetriever.retrieve(ArtifactRetriever.java:95)
        at com.simpligility.maven.provisioner.MavenRepositoryProvisioner.retrieveArtifacts(MavenRepositoryProvisioner.java:122)
        at com.simpligility.maven.provisioner.MavenRepositoryProvisioner.main(MavenRepositoryProvisioner.java:68)
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to read artifact descriptor for net.bigcorp.thirdparty:product-catalog:zip:static:1.296
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:208)
        at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:307)
        ... 4 common frames omitted
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for net.bigcorp.thirdparty:product-catalog:zip:static:1.296
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:323)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
        at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:202)
        ... 5 common frames omitted
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from/to central (https://repository.admin.bigcorp.net/repository/releases): Bad Request (400)
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:178)
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:224)
        at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1051)
        at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:829)
        at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:331)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:314)
        ... 7 common frames omitted
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from/to central (https://repository.admin.bigcorp.net/repository/releases): Bad Request (400)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
        at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:174)
        ... 12 common frames omitted
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact net.bigcorp.thirdparty:product-catalog-parent:pom:3.1-SNAPSHOT from/to central (https://repository.admin.bigcorp.net/repository/releases): Bad Request (400)
        at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:365)
        at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:583)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:259)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
        at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
        ... 15 common frames omitted
Caused by: org.apache.http.client.HttpResponseException: Bad Request (400)
        at org.eclipse.aether.transport.http.HttpTransporter.handleStatus(HttpTransporter.java:475)
        at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:300)
        at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:252)
        at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:67)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:453)
        at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:360)
        ... 20 common frames omitted
16:05:42.759 [main] INFO  ArtifactRetriever - Processing POM file /Users/nsteinmetz/Documents/Clients/bigcorp/bigcorp-ops/ansible/roles/LF.nexus/files/local-cache/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296.pom
16:05:42.764 [main] INFO  LoggingRepositoryListener - Resolving artifact net.bigcorp.thirdparty:product-catalog:jar:1.296
16:05:42.764 [main] INFO  LoggingRepositoryListener - Downloading artifact net.bigcorp.thirdparty:product-catalog:jar:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:42.765 [main] INFO  LoggingTransferListener - Downloading: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296.jar
16:05:43.094 [main] INFO  LoggingTransferListener - Downloaded: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296.jar (2783 KB at 8458.5 KB/sec)
16:05:43.096 [main] INFO  LoggingRepositoryListener - Downloaded artifact net.bigcorp.thirdparty:product-catalog:jar:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.096 [main] INFO  LoggingRepositoryListener - Resolved artifact net.bigcorp.thirdparty:product-catalog:jar:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.096 [main] INFO  ArtifactRetriever - Retrieved /Users/nsteinmetz/Documents/Clients/bigcorp/bigcorp-ops/ansible/roles/LF.nexus/files/local-cache/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296.jar
16:05:43.096 [main] INFO  LoggingRepositoryListener - Resolving artifact net.bigcorp.thirdparty:product-catalog:jar:sources:1.296
16:05:43.097 [main] INFO  LoggingRepositoryListener - Downloading artifact net.bigcorp.thirdparty:product-catalog:jar:sources:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.098 [main] INFO  LoggingTransferListener - Downloading: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296-sources.jar
16:05:43.258 [main] INFO  LoggingTransferListener - Downloaded: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296-sources.jar (275 KB at 1715.6 KB/sec)
16:05:43.260 [main] INFO  LoggingRepositoryListener - Downloaded artifact net.bigcorp.thirdparty:product-catalog:jar:sources:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.260 [main] INFO  LoggingRepositoryListener - Resolved artifact net.bigcorp.thirdparty:product-catalog:jar:sources:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.260 [main] INFO  ArtifactRetriever - Retrieved /Users/nsteinmetz/Documents/Clients/bigcorp/bigcorp-ops/ansible/roles/LF.nexus/files/local-cache/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296-sources.jar
16:05:43.260 [main] INFO  LoggingRepositoryListener - Resolving artifact net.bigcorp.thirdparty:product-catalog:jar:javadoc:1.296
16:05:43.261 [main] INFO  LoggingRepositoryListener - Downloading artifact net.bigcorp.thirdparty:product-catalog:jar:javadoc:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.262 [main] INFO  LoggingTransferListener - Downloading: https://repository.admin.bigcorp.net/repository/releases/net/bigcorp/thirdparty/product-catalog/1.296/product-catalog-1.296-javadoc.jar
16:05:43.385 [main] INFO  LoggingTransferListener - Could not find artifact net.bigcorp.thirdparty:product-catalog:jar:javadoc:1.296 in central (https://repository.admin.bigcorp.net/repository/releases)
16:05:43.385 [main] INFO  LoggingRepositoryListener - Downloaded artifact net.bigcorp.thirdparty:product-catalog:jar:javadoc:1.296 from central (https://repository.admin.bigcorp.net/repository/releases, default, releases+snapshots)
16:05:43.385 [main] INFO  LoggingRepositoryListener - Resolved artifact net.bigcorp.thirdparty:product-catalog:jar:javadoc:1.296 from null
16:05:43.385 [main] INFO  ArtifactRetriever - ArtifactResolutionException when retrieving net.bigcorp.thirdparty:product-catalog:1.296 with javadoc
16:05:43.385 [main] INFO  MavenRepositoryProvisioner - Artifact retrieval completed.
16:05:43.385 [main] INFO  MavenRepositoryProvisioner - Artifact deployment starting.
16:05:43.533 [main] INFO  MavenRepositoryHelper - Found POM for net.bigcorp.thirdparty:product-catalog:1.296 already in target. Skipping deployment.
16:05:43.595 [main] INFO  MavenRepositoryProvisioner - Artifact deployment completed.
16:05:43.595 [main] INFO  MavenRepositoryProvisioner - Processing Completed.
16:05:43.596 [main] INFO  MavenRepositoryProvisioner -
Processing Summary
-----------------------------------
Configuration:

Provisioning artifacts: net.bigcorp.thirdparty:product-catalog:zip:static:1.296
Source: https://repository.admin.bigcorp.net/repository/releases
Target: https://nexus.bigcorp.net/repository/releases/
Username: deployment
Password: ***************************************
IncludeSources: true
IncludeJavadoc: true
IncludeProvidedScope: true
IncludeTestScope: true
IncludeRuntimeScope: true
Check target: true
Verify only: false
Local cache or source repository directory: local-cache

Sucessful Retrievals:

net.bigcorp.thirdparty:product-catalog:jar:1.296
net.bigcorp.thirdparty:product-catalog:jar:sources:1.296

Failed Retrievals:

Could not find artifact net.bigcorp.thirdparty:product-catalog:jar:javadoc:1.296 in central (https://repository.admin.bigcorp.net/repository/releases)
Failed to read artifact descriptor for net.bigcorp.thirdparty:product-catalog:zip:static:1.296

Sucessful Deployments:

Failed Deployments:

Skipped Deployments (POM already in target):

net.bigcorp.thirdparty:product-catalog:1.296

Potential Deployments :

16:05:43.619 [main] INFO  MavenRepositoryProvisioner - Exiting: SUCCESS
Failed to retrieve some artifacts.
Deployment completed successfully.

I'm not a java dev but from what I saw, this case is not managed.

From what I understand and I may be wrong:

  • Your GAV object is just about groupid, artefact, packaging (few use cases managed) and version
  • I don't see how classifier and version are extracted from the -a parameter
  • You only support the main cases (jar + javadoc + test + sources) for my packaging.

How could I add the missing parameters ?

Thanks,
Nicolas

Retrieve main artifact

when the parameter asks for a classifier one.

E,g "com.google.inject:guice:jar:no_aop:3.0" should retrieve the no_aop as well as the normal jar. Currently it gets pom, sources, javadoc and classifier jar but not the main jar.

Might have to parse pom for packaging to determine what the main one actually is.

Support configuration to allow scope config

Currently filters for compile only and pulls those. Might want to check and allow provided and also ones that have optional set to true.

Maybe even change default to pull in all scopes. Probably yes.. pull in all. Should do some testing..

E.g check com.hazelcast:hazelcast:3.7.2 see

Implement "GAV transformation"

Use case: you have a project (maybe not even yours, for example on Central, an OSS project) that you need to fork. As we know, best practice is to change GAV of fork (either "move" it under your groupID, or at least change version to 1.0.0-simpligility). So, would be cool, if I could make it get G:A:V from Central, but deploy it as G2:A:V (or G:A:V2 or whatever) to my hosted repository. As this would then allow me to "patch" selectively, instead to rebuild whole (potentially huge) project, I could just "fix" the spot I have to, one or two modules. Example: https://issues.apache.org/jira/browse/MNG-7475

(note: this is just a rough idea, and the example above may not be even feasible due complex project tree and POM imports and so on)

This is NOT trivial, as it would require POM "rewrites" as well (and nearly impossible in case of maven-plugins as there plugin artifact GAV and plugin metadata embedded in JAR must be aligned). So, let's keep it simple (could simply fail for some known packaging that cannot be processed like this). Re-checksumming (due POM rewrites) could happen automatically using resolver/aether on deploy.

Cannot run .jar file using test.sh, Guice creation errors

  1. Download source
  2. mvn clean install
  3. ./test.sh

ERRORS at most basic level trying to run the jar:
Exception in thread "main" com.google.inject.CreationException: Guice creation errors:

  1. No implementation for org.apache.maven.model.composition.DependencyManagementImporter was bound.
    while locating org.apache.maven.model.composition.DependencyManagementImporter
    for field at org.apache.maven.model.building.DefaultModelBuilder.dependencyManagementImporter(DefaultModelBuilder.java:207)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  2. No implementation for org.apache.maven.model.management.DependencyManagementInjector was bound.
    while locating org.apache.maven.model.management.DependencyManagementInjector
    for field at org.apache.maven.model.building.DefaultModelBuilder.dependencyManagementInjector(DefaultModelBuilder.java:213)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  3. No implementation for org.apache.maven.model.inheritance.InheritanceAssembler was bound.
    while locating org.apache.maven.model.inheritance.InheritanceAssembler
    for field at org.apache.maven.model.building.DefaultModelBuilder.inheritanceAssembler(DefaultModelBuilder.java:201)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  4. No implementation for org.apache.maven.model.plugin.LifecycleBindingsInjector was bound.
    while locating org.apache.maven.model.plugin.LifecycleBindingsInjector
    for field at org.apache.maven.model.building.DefaultModelBuilder.lifecycleBindingsInjector(DefaultModelBuilder.java:219)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  5. No implementation for org.apache.maven.model.interpolation.ModelInterpolator was bound.
    while locating org.apache.maven.model.interpolation.ModelInterpolator
    for field at org.apache.maven.model.building.DefaultModelBuilder.modelInterpolator(DefaultModelBuilder.java:165)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  6. No implementation for org.apache.maven.model.normalization.ModelNormalizer was bound.
    while locating org.apache.maven.model.normalization.ModelNormalizer
    for field at org.apache.maven.model.building.DefaultModelBuilder.modelNormalizer(DefaultModelBuilder.java:159)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  7. No implementation for org.apache.maven.model.path.ModelPathTranslator was bound.
    while locating org.apache.maven.model.path.ModelPathTranslator
    for field at org.apache.maven.model.building.DefaultModelBuilder.modelPathTranslator(DefaultModelBuilder.java:171)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  8. No implementation for org.apache.maven.model.building.ModelProcessor was bound.
    while locating org.apache.maven.model.building.ModelProcessor
    for field at org.apache.maven.model.building.DefaultModelBuilder.modelProcessor(DefaultModelBuilder.java:147)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  9. No implementation for org.apache.maven.model.path.ModelUrlNormalizer was bound.
    while locating org.apache.maven.model.path.ModelUrlNormalizer
    for field at org.apache.maven.model.building.DefaultModelBuilder.modelUrlNormalizer(DefaultModelBuilder.java:177)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  10. No implementation for org.apache.maven.model.validation.ModelValidator was bound.
    while locating org.apache.maven.model.validation.ModelValidator
    for field at org.apache.maven.model.building.DefaultModelBuilder.modelValidator(DefaultModelBuilder.java:153)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  11. No implementation for org.apache.maven.model.plugin.PluginConfigurationExpander was bound.
    while locating org.apache.maven.model.plugin.PluginConfigurationExpander
    for field at org.apache.maven.model.building.DefaultModelBuilder.pluginConfigurationExpander(DefaultModelBuilder.java:225)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  12. No implementation for org.apache.maven.model.management.PluginManagementInjector was bound.
    while locating org.apache.maven.model.management.PluginManagementInjector
    for field at org.apache.maven.model.building.DefaultModelBuilder.pluginManagementInjector(DefaultModelBuilder.java:231)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  13. No implementation for org.apache.maven.model.profile.ProfileInjector was bound.
    while locating org.apache.maven.model.profile.ProfileInjector
    for field at org.apache.maven.model.building.DefaultModelBuilder.profileInjector(DefaultModelBuilder.java:195)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  14. No implementation for org.apache.maven.model.profile.ProfileSelector was bound.
    while locating org.apache.maven.model.profile.ProfileSelector
    for field at org.apache.maven.model.building.DefaultModelBuilder.profileSelector(DefaultModelBuilder.java:189)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  15. No implementation for org.apache.maven.model.plugin.ReportConfigurationExpander was bound.
    while locating org.apache.maven.model.plugin.ReportConfigurationExpander
    for field at org.apache.maven.model.building.DefaultModelBuilder.reportConfigurationExpander(DefaultModelBuilder.java:237)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  16. No implementation for org.apache.maven.model.plugin.ReportingConverter was bound.
    while locating org.apache.maven.model.plugin.ReportingConverter
    for field at org.apache.maven.model.building.DefaultModelBuilder.reportingConverter(DefaultModelBuilder.java:243)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

  17. No implementation for org.apache.maven.model.superpom.SuperPomProvider was bound.
    while locating org.apache.maven.model.superpom.SuperPomProvider
    for field at org.apache.maven.model.building.DefaultModelBuilder.superPomProvider(DefaultModelBuilder.java:183)
    at org.apache.maven.repository.internal.MavenResolverModule.configure(MavenResolverModule.java:58)

17 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:154)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at com.simpligility.maven.provisioner.RepositoryHandler.newRepositorySystem(RepositoryHandler.java:46)
at com.simpligility.maven.provisioner.RepositoryHandler.getRepositorySystem(RepositoryHandler.java:39)
at com.simpligility.maven.provisioner.ArtifactRetriever.initialize(ArtifactRetriever.java:75)
at com.simpligility.maven.provisioner.ArtifactRetriever.(ArtifactRetriever.java:70)
at com.simpligility.maven.provisioner.MavenRepositoryProvisioner.retrieveArtifacts(MavenRepositoryProvisioner.java:121)
at com.simpligility.maven.provisioner.MavenRepositoryProvisioner.main(MavenRepositoryProvisioner.java:68)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.