Maven Configuration Issue : Failed to find plugin prefix deploy - maven

I am trying to setup Maven(3.2.5) on linux with nexus repo for non Java artifacts. I was going through all the SO questions, and got to know that with Maven command line, one can publish artifacts to repo without POM for non java artifacts.
When I am running maven deploy file command to push non java artifacts(zip file) to nexus repo, and it throws the following error
"Failed to find plugin prefix deploy". I
Here is the pluginGroup tag from my settings.xml, which is under conf dir. How do I get rid of this failed to find plugin error.
Thanks for your time!
<pluginGroups>
<pluginGroup>org.apache.maven.plugins</pluginGroup>
</pluginGroups>

This plugin group tag is not required in setting.xml file. I was not able to download plugin from maven due to firewall issue.
after setting up proxy, I was able to use maven build successfully.

Related

Integrate the local maven plugin with remote repository

I have created a simple maven plugin and installed it in my local repo(.m2). Now I want to use that plugin with a git repo(maven project). How can I do that?
Currently, I am trying to build my git repo using Jenkins and it throws below error-
[ERROR] Plugin sample.plugin:hello-maven-plugin:0.0.1-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact sample.plugin:hello-maven-plugin:jar:0.0.1-SNAPSHOT
I believe simply changing the pom file of my git repo won't work. What should I do so that it resolves the plugin dependency by looking into the .m2 dir first
Your Jenkins probably deploys to a Nexus or Artifactory server. That server is also the right place to manage your plugin.

Download Maven artifacts in Jenkins from another repo if one fails

In my Jenkins build I have a settings.xml file for pulling Maven dependencies. An artifact, if not found, should be downloaded from another Maven repo not specified in a settings file. Can this be done using code in Jenkinsfile? Any thought will be greatly appreciated.

Creating maven project from local Maven repo

I am trying to create a maven project in a Windows virtual machine. But am unable to create as there is a proxy setting that doesn't allow me to connect to https://repo.maven.apache.org/maven2
But I do have another link that have the maven repos. But am not sure how to create the maven project using the link that I have. Can someone help me?
Thanks
You can specify another repository in your pom.xml file, but you’ll have to do it for every maven project you’ll build.
You can also specify that repository in your settings.xml file, which will be available to all maven projects.
See the informations here : https://maven.apache.org/guides/mini/guide-multiple-repositories.html

Add custom, local project to integration-distribution

I am trying to add a custom project to the distribution. The project that I created via
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ -DarchetypeCatalog=remote -DarchetypeVersion=1.6.0-SNAPSHOT
is (obviously) not available via the official nexus. I did not do any changes to this project.
I fired up karaf in distribution and tried to add the new project as a new repository via
feature:repo-add mvn:org.opendaylight.flowlistener/features-flowlistener/0.1.0-SNAPSHOT/xml/features
and received this error:
Adding feature url mvn:org.opendaylight.flowlistener/features-flowlistener/0.1.0-SNAPSHOT/xml/features
Error executing command: Error resolving artifact org.opendaylight.flowlistener:features-flowlistener:xml:features:0.1.0-SNAPSHOT: [Could not find artifact org.opendaylight.flowlistener:features-flowlistener:xml:features:0.1.0-SNAPSHOT in opendaylight-snapshot (https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/)] : mvn:org.opendaylight.flowlistener/features-flowlistener/0.1.0-SNAPSHOT/xml/features
Is it generally possible to add projects that only exist locally? What am I doing wrong?
Thanks in advance!
Max
Artifact repositories are configured using etc/org.ops4j.pax.url.mvn.cfg in Karaf. The configuration shipped in OpenDaylight only uses the Karaf system directory; it ignores the local Maven repository entirely.
To add your local Maven repository, you should edit the org.ops4j.pax.url.mvn.repositories entry at the end of the file to include your Maven repository:
org.ops4j.pax.url.mvn.repositories= \
file:${karaf.home}/${karaf.default.repository}#id=system.repository, \
file:${karaf.data}/kar#id=kar.repository#multi, \
file:${user.home}/.m2/repository#snapshots#id=m2.repository
By the way, unless you intend to contribute your project to OpenDaylight, you should avoid using the org.opendaylight namespace.
Karaf distribution uses the settings in etc/org.ops4j.pax.url.mvn.cfg to resolve maven artifacts. You will have to tweak these settings (e.g. maven local repo) for the distribution to find your local project. There is some in-line documentation on how to edit this file:
https://github.com/apache/karaf/blob/master/assemblies/features/base/src/main/resources/resources/etc/org.ops4j.pax.url.mvn.cfg

How to change maven repository for intelliidea's plugins?

I'm using Intellij idea build: IU-171.3780.107 in Ubuntu 16.04. I need to use docker plugin.
At beginning docker plugin need to download dependencies for maven central (http://maven.central.org). I am behind of a proxy and it deny my access to this site
Intellij idea error:
Failed to download client libraries: Failed to download 'http://central.maven.org/maven2/com/github/docker-java/docker-java/3.0.0/docker-java-3.0.0.jar'
but i have guaranty access to another maven repository linked to maven central
How i change maven repository address, used by intellij idea for plugins download, to my maven local config in .m2 (setting.xml)
Note: I don't have problem with dependencies for my own project because it use successfully my setting in .m2 directory, the problem is with a intellij idea plugins.

Resources