maven dependency error when i start to install mvn -nsu - maven

Failed to execute goal on project netconf-exercise-impl: Could not resolve dependencies for project org.sdnhub.odl.tutorial.netconf-exercise:netconf-exercise-impl:bundle:1.0.0-SNAPSHOT: The following artifacts could not be resolved: openexi:nagasena:jar:0000.0002.0053.0, openexi:nagasena-rta:jar:0000.0002.0053.0: Failure to find openexi:nagasena:jar:0000.0002.0053.0 in http://nexus.opendaylight.org/content/repositories/opendaylight.release/ was cached in the local repository, resolution will not be reattempted until the update interval of opendaylight-release has elapsed or updates are forced -> [Help 1]

Yeap, had the exact same error, but copying the settings.xml from the official ODL wiki did it for me.
Just used this command from the wiki's instructions:
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml

Same issue here. I am actively searching for an alternative jar location for nagasena and nagasena-rta so we can just update the repository list.

According to the OpenDaylight Wiki. You need to
Edit your ~/.m2/settings.xml
OpenDaylight maintains its own repositories outside of Maven Central, which means maven cannot resolve OpenDaylight artifacts by default. Since OpenDaylight is organized as multiple inter-dependent projects, building a particular project usually means pulling in some artifacts. In order to make this work, your maven installation needs to know the location of OpenDaylight repositories and has to taught to use them.
This is achieved by making sure ~/.m2/settings.xml looks something like the copy kept in odlparent. You can do that quickly with the following command"
cp -n ~/.m2/settings.xml{,.orig} ; \
wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
after this you can then re-run mvn -nsu
“mvn clean install -nsu”

As pointed out by ShamanPrime and user2719303, you must configure your env with a custom ~/.m2/settings.xml file.
Full instructions are here: https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup

Related

OpenDaylight Archetypes JAR Fluorine Not in Repository?

I am trying to install OpenDaylight Fluorine. Per the developer guide i am to call mvn generate:archetype alongside some other parameters which can be found here: link
However, due to the incorrect formatting of the repo's that documention seems to be incorrect.
I've found what i thought to be the correct nexus repo. Here's the link for the nexus repo: link
Here's the command i am trying to run:
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller.archetypes -DarchetypeArtifactId=archetypes-parent -DarchetypeVersion=0.9.0-SNAPSHOT -X
My problem is that when i run it i am getting the error:
org.apache.maven.archetype.downloader.DownloadException: Error downloading org.opendaylight.controller.archetypes:archetypes-parent:jar:0.9.0-SNAPSHOT.
Which makes sense because there isn't a jar there in the repo. My question is where could i find this JAR at? Or am i not running the maven command properly? If i go to parent directories none of the previous releases have a JAR either. I can't find any documentation on another way to install this so any help would be greatly appreciated.
The archetype artifacts had expired from our repository (which is a side-effect of our unfortunate reliance on snapshot artifacts). We’ve update the archetypes and pushed them to the repository again; they are available here and usable with
mvn archetype:generate -DarchetypeGroupId=org.opendaylight.archetypes \
-DarchetypeArtifactId=opendaylight-startup-archetype \
-DarchetypeCatalog=remote -DarchetypeVersion=1.0.0-SNAPSHOT

Maven Build : was cached in the local repository

I am trying to build the multi module maven project but getting the error as below.
Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:0.0.24 or one of its dependencies could not be resolved: Failure to find com.day.jcr.vault:content-package-maven-plugin:jar:0.0.24 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 2]
Unknown packaging: content-package # com.prj.prj.aem:aem-parent.ui.apps:[unknown-version], C:\latest\prj\ui.apps\pom.xml, line 34, column 16
I have the jar file content-package-maven-plugin-0.0.24.jar at C:\Users\user.m2\repository\com\day\jcr\vault\content-package-maven-plugin\0.0.24 location
You can do this.
mvn clean package -DskipTests -U -e
Notice that -U means to reload the jars from maven, that ignore the cache jars in your local file system.
Do you have the Adobe profile in your settings?
https://docs.adobe.com/docs/en/aem/6-2/develop/dev-tools/vlt-mavenplugin.html
(section "Obtaining the Content Package Maven Plugin")
I had the same issue as you, and resolved it by setting the activeByDefault to true in .m2/settings.xml
I faced a similar issue while using IntelliJ IDEA. Problem was that Idea has set a different maven home as I need to.
When you have this problem also with Idea, check your Settings -> Maven -> Maven home directory setting, if it is set as you need to.

Building Valkyrie RCP

I'm trying to build Valkyrie RCP from the 1.2 release. According to their instructions, it should be easy: "Just clone the repository, and then use a mvn install command."
However, when I try the command, I get the following error:
[ERROR] Failed to execute goal on project valkyrie-rcp-core: Could not
resolve dependencies for project dk.navicon:valkyrie-rcp-core:jar:1.2:
Failure to find com.l2fprod:l2fprod-common-all:jar:7.3 in
http://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced -> [Help 1]
I can see that l2fprod-common-all-7.3.jar is included in the dependencies folder but Maven seems to be unaware of that. How should I resolve this problem?
Actually, it's now possible to build it using Gradle, which doesn't have the dependency issues . Also, there's a dependencies folder with batch scripts to install the missing dependencies if you still wish to use Maven.
As of 2.0 Valkyrie RCP will use Gradle.
The problem is that the given version of that dependency does not exist in Maven Central only older versions.
They would probably suggest you do a mvn install first on the file in the dependencies folder, then.
Try go down in deps and do a
mvn install -DgroupId=com.l2fprod -DartifactId=l2fprod-common-all -Dversion=7.3 -Dpackaging=jar -Dfile=l2fprod-common-all-7.3.jar
That would get you past that point locally.
After that re-execute your project build with a -Uoption.
Long term is to find the artifact and include it in a repository that is searchable from your maven settings or project profile.

What is maven clean repo building?

I am new to maven and I heard the term "maven clean repo" building ? What is the meaning of this ? How it different from the normal maven building process ? Also I want to know about the maven repository and how it changes when we build the software
I'm not sure if there is an exact term called "maven clean repo building" - but it is probably referring to doing a clean build by clearing out your entire LOCAL maven repository to ensure you have only the correct dependencies for your project.
All dependencies you need get downloaded into the repository which is at ${user.home}/.m2/repository by default. You can see this grows as the build runs and dependencies get downloaded into this folder.
The link
http://maven.apache.org/plugins/maven-dependency-plugin/examples/purging-local-repository.html explains one way of purging this.
You can change the maven repo being used for the build by providing the following argument to the build command
mvn clean install -Dmaven.repo.local=/tmp/sampleRepo
If relevant artifacts are not available in the pointed maven repo, it will download them from relevant repositories (maven central or repositories which are provided in the pom.xml file).
Hint;) Using a directory in /tmp/ will be more good as /tmp/ get automatically cleared in OS restart.

Maven without Internet connection

I'm new to maven project.
I'm changing an ant project to maven project.
To install the 3rd party jar's in maven local repository, I used install command.
Its trying to download the resource jar.pom.
I don't have download access in my organization so the build failed for installtion.
After request i got the resouce jar and clean jar in my desktop(also i can get other necessary jar).
How to make maven to use these jar for the process and how to install the jar in local repository without internet acess.
I downloaded the jar and placed in local repository but it couldn't point the path and use those jars.
please let me know what steps i have follow to run maven install and other commands to build the project without internet access.
where should i placed the jar which i have downloaded by external way.
Please guide me for building and deploying the project.
Thanks in advance.
http://maven.40175.n5.nabble.com/Maven-installation-and-using-in-project-without-Internet-conncetion-tp4564443p4564443.html.
http://www.coderanch.com/t/544641/Jobs-Offered/careers/Maven-installation-project-without-Internet#2471141
I've posted same question in these link
You need an internet connection. Maven isn't initially self-sufficient. It needs to download a bunch of plugins along with their dependencies and the dependencies of your own project. And this really depends on what sort of settings you have for your projects. One set up will require one set of dependencies, another - a whole different one. You can't download artifacts from the Maven Central manually and then install them locally one by one. Simply put, that sounds stupid.
I understand that you're coming from the Ant world where Ant has everything it needs on the local file system. However, Maven relies on the fact that it will have a central repository (either Maven Central, or your own repository - Nexus, Artifactory, etc.) from which to download the plugins and dependencies it needs. There is no point in you migrating to Maven, unless you'll be allowed access to the Central Maven Repository.
Yes, indeed, you can run Maven offline and you can have Maven produce a local repository for you to use when you are in offline mode. However, what you're trying to do is against Maven's principles.
If your company won't allow access to Maven Central, just stick to Ant. Your effort will be a waste of your company's and, ultimately, your own time.
In fact the maven strenght is mainly in the internet accessible repositories and automatic dependency management. But it's possible to use this tool to build your project if you have all dependencies required for your project in your local repository. Then you may use -o option for offline mode and maven will not try to download updated artefact versions.
To get the artifacts into you local repository you have several options:
1) connect to the internet once and mvn build the project (this will download all required dependencies)
2) install dependencies as jar to the local repository manualy (using appropriate mvn command)
I think the questioner is looking for -o or --offline option for mvn. This is a command line option and can be provided while executing.
I think you can setup your repo correctly and execute the mvn goals once when you are connected to internet and use the -o option for later executions .
Hope this helps.
~Abhay
You can configure maven to run in offline mode. Add this entry to your settings.xml
<offline>true</offline>
See here for further information:
http://maven.apache.org/settings.html
Before you can use offline mode, you have to install all necessary third party jars to your local maven repository.
mvn install:install-file
-Dfile=filename.jar
-DgroupId=com.stackoverflow
-DartifactId=artifact
-Dversion=1.0.0
-Dpackaging=jar
-DcreateChecksum=true
-DgeneratePom=true
It's much easier to get those jars in your local repository using an internet connection and online mode.
It's possible to install these resource jars in your local maven repo using install-file. This will make the available to the build. You'll have to do this for each individually, but once that's done you won't have to do anything special.
To be clear, maven puts everything in your local repository, both the jar you're building with this project and the various library jars. Because your system cannot be connected to the internet to maven can populate the local repo with your libraries, you'll have to use this manual approach.
Edit: You should be able to run install-file anywhere. When you do, you'll need to provide the groupId, artifactId, version, and packaging using the command line options. If you already have a POM file for the library, you can provide that instead via -DpomFile=your-pom.xml.
This question has some useful info: How to manually install an artifact in Maven 2?

Resources