If you have a third party jar that you don't build yourself, you can upload it to CloudRepo with the Maven.

Run the following commands from a directory containing a pom.xml file that has been configured to read and write to CloudRepo.

If you haven't set this up yet, please following our Getting Started with Maven instructions and then return to this page. 

Uploading a Jar and Pom file

If possible, you should upload jars along with their pom files.  Without the pom file, Maven will not be able to retrieve transitive dependencies for the jar and this can cause problems in your builds.

mvn deploy:deploy-file -DpomFile=<path-to-pom \
-Dfile=<path-to-jar-file> \
-DrepositoryId=io.cloudrepo \
-Durl=<your-cloudrepo-repository-url>

Using this command will extract the artifact-id, group-id, and version from the pom file and ensure that the jar file is uploaded to the appropriate location in CloudRepo.

Upload a Jar File Without a Pom File
Although it is not recommended, sometimes you will not have a pom file to upload along with your Jar.   When this happens, you'll have to specify the group-id, artifact-id, and version explicitly using the following command:

mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion = <version> \
-Dpackaging = jar \
-Dfile=<path-to-jar-file> \
-DrepositoryId=io.cloudrepo \
-Durl=<your-cloudrepo-repository-url>

Upload a Pom file without a Jar

You may have the case where you need to upload a pom file without a jar.   This happens particularly when you have a parent pom.

Run the following command to upload a pom file only:

mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion = <version> \
-Dpackaging = pom \
-Dfile=<path-to-pom-file> \
-DrepositoryId=io.cloudrepo \
-Durl=<your-cloudrepo-repository-url>

Advanced Scenarios

If you need more information, please consult the Maven Guide to deploying 3rd party JARs to remote repository guide.

Did this answer your question?