maven local custom repo - maven-3

I would use my server as local repo for some jar. I can install single jar into .m2 repo but I can't use this repo into my project's pom. How I use my server as maven repo?

You should check your configuration. Check MAVEN_HOME, settings.xml etc.

Related

jfrog artifactory CLI deploy a jar in maven artifactory repo with inferred setting from jar

I am using Visual Studio Artifactory deployer to deploy jar files built by maven to Artifactory maven repo. If I use maven artifactory plugin the jar file gets deployed to right folder structure and maven setting stay as per the jar but from CLI if i push the jar file, it only get deployed as a jar file to the folder I specify. For example
Using CLI push a artifact.jar to target libs-snapshot/com/foo/bar
gets file uploaded to libs-snapshot/com/foo/bar and artifactory has
no information about jar version, group id , artifact id. I could not
find any options on the CLI to specify those.
While using Maven Artifactory plugin, a pushed jar ends up in
libs-snapshot/com/foo/bar/artifact/version folder and maven
properties stay intact
How do I achieve same behaviour from CLI as maven artifactory plugin does.
Just to make sure, how do you use the CLI for the deployment? In order to have it deployed to Artifactory using the CLI, you will have to specify the right Maven coordinates. For example:
jfrog rt u mySnapshot-1.0.0-SNAPSHOT.jar “libs-snapshot-local/path/to/folder/mySnapshot/1.0.0-SNAPSHOT/”
This will deploy your snapshot file to Artifactory and Artifactory, base on your repository configuration will replace the “SNAPSHOT” with a timestamp.
If you meant that you want to deploy 5 different files, to 5 different paths and that you wish that the JFrog CLI to extract the maven layout and deploy by it, then this is not possible by using the CLI.

build from git repository and than clone another repository in a subfolder

I've correctly setup jenkins to build my sources from my git repository and to deploy it using codedeploy plugin.
my project structure is the following :
main_folder
|- subfolder1
|- subfolder2
|- subfolder3
at this point there's another subfolder called subfolder4 that is a cloned out from another git repository.
Actually i clone the second repository from the script that codedeploy runs after installing the sources, but i'm facing issues with the ssh-key.
How can i configure jenkins to download subfolder4 content from another git repository ? thanks everyone
Multiple SCMs Plugin
Allows your job to check out sources from multiple repository.
for the second repository just choose additional Behaviours -> check out to a sub-directory

how can i create a local copy of grails repository

Hi i ll like to create a working copy of grails plugin repository. This is not a git or svn repo.
http://repo.grails.org/grails/core/#
I install Artifactfactory but it don't have that option.
Any help is appreciated
thanks
It's a maven repo, you can setup a proxy in artifactory by folliwng the docs here: https://www.jfrog.com/confluence/display/RTF/Configuring+Repositories

How to install grails plugin from github repo?

I looked in the Grails docs, but I could not find how to instruct the BuildConfig.groovy to tell my Grails app to get a plugin from a github repo. This is the repo I want to include, https://github.com/westonplatter/backbonejs-grails-plugin.
You have to clone (or fork based on your need) the repo and build the plugin to create a zip and then use the plugin as a plugin dependency in BuildConfig.
Once cloned, you can use grails maven-install on the plugin so that the zip would be available in local .m2 repo if you have one. Follow this for steps and this for a similar answer.
Otherwise, you can directly use the plugin in your app by following this answer or refer Specifying Plugin Locations.

How do I remove a cached local artifact that maven fetched?

After running maven commands, the jboss artifact sits cached in my local repo /.m2. However, it's the wrong copy, and we have updated our artifactory on the local server. How do I remove this cached copy? (other than manually deleting the jboss folder from the /.m2/repository/org folder). Is there a maven command to do so? Also, I was wondering how exactly the local repository is structured, is it according to groupId, artifactId, version (GAV) in any way?
Snapshot artifacts can be force-updated by using -U option with mvn when building a project with the dependency. Maven will take the newest snapshot available of the specified version. You have to deploy the fixed snapshot artifact to the repository before. The newest snapshot is determined by the timestamp attached to the file name of the jar.
However, release versions are not updated. Once a release artifact has been downloaded and verified, you must remove it manually if you replaced it on a remote repository. Generally, you should never replace release version artifacts. Rather you should always release a new version (and possibly delete the erroneous version from the repository) and change the pom.xml files of projects which use this artifact.
For the structure of the local/remote repository, see links below.
References:
Force maven update
maven artifact repository directory structure specs
Maven repository layout

Resources