Set properties for existing artifact in Artifactory Pro from script - maven

I'm looking for CLI or Rest API command which allows to set (or update?) properties to artifact with specified GAV and repository name. Is it possible?
The artifact shouldn't be uploaded, it's already there (in Artifactory Maven repository).

There you go:
https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-SetItemProperties
Using this REST API you can just add properties on an artifact in Artifactory.

Related

Using gradle and the jfrog artifactory plugin how can I upload a generic artifact to a generic repository

I have a special build script that outputs an Alpine APK that I need to upload to a generic Artifactory repository. How do I mark the apk output as an artifact that needs to be picked up and published?
If you're using CloudRepo repository, you could just POST with a curl. You might be able to do this with Artifactory.

tell maven to get JAR dependency from given URL

Unfortunately, my project has an external dependency that was never published to any Maven repository. The only way I can get it is by direct download from github (they pushed the binary to github).
One (bad) way is to download the jar manually and commit/push it to my code repository (git). It wouldn't help me to manually deploy this artifact in my local binary repository because I share this project with external contributors that cannot access my private binary repo.
I wonder if maven has a better way to handle this? (Given that I can't upload the artifact to my repo or public repo).
I know that npm allows getting some dependencies from URL. Does maven support it as well?
AFAIK there is no nice way to handle this. You could
Write a script that downloads the jar and installs it in your local Maven repository. This script could be shared through your code repository.
Include downloading and installing the artifact into the Maven build process (by writing a Maven plugin or using the antrun plugin)
Set up a nexus in the cloud that everyone in your team can access.

Automatically download missing artifacts if missing in Artifactory

I'm using Jfrog Artifactory to contain artifacts. I'm building with Maven. Is there a way to configure Maven to automatically download missing artifacts, artifacts that are not in the Artifactory repo.
Example:
org.maven.framework-2.5.0 is downloaded from Artifactory since it exists in the Artifactory.
org.maven.anotherframework-2.2.2 doesn't exists in Artifacotry. How to set maven to get from internet?
Is it common to use Artifactory this way?
You should configure Artifactory to fetch missing artifacts from the Internet, not Maven.
Artifactory can (and should) be used as a proxy:
It already comes with set a pre-configured popular remote repositories and you can add new ones.
So, if Maven fails on unresolved dependency, find a repository that has it, add it to Artifactory as remote repository, retry the build. If you can't find any repository that has it, you can upload the jar directly to Artifactory and retry the build.

maven artifacts for local repository

I want to create a local repository for maven. For that, I have to download all required artifacts. Is there any direct download link available for all artifacts to be downloaded once?
The local repository will be automatically be created during your first call of Maven in relationship with a project. The default location for the local repository is $HOME/.m2/repository.
You don't need to download dependencies etc. cause Maven will do that automatically.

How to create the repository (role is repository manager)with nexus

i created a maven repository using nexus and upload the jars files.Same way how to upload the maven plugins to repository.i directly add the maven-complier-plugin,it is not working.it will gives some exception like org.apahce,parenet ,plexus ,codehaus required and org.apache.maven.lifecycle errors are geting..
i will not be maven central repository,only using commpany repository includes every in my repository jars and maven plug
plz help me i am first create the repository.
Did you specify a mirror in your settings.xml file? If you want to force all users to use your repo and not repo1.maven.org, you'll need to enforce that. Also, you probably want your nexus to proxy central so that any artifact you don't host will still be available once you setup the mirror to block all outside repos.

Resources