I faced a problem with com.netflix.eureka:eureka-client:2.0.0-rc.4 build
(Sorry for pom screenshots, was too much code here)
pom1
pom2
pom3
How can I resolve this dependency?
I tried to add a dependency
But it didn't help.
Maven clean install and deleting .m2 repo also didn't help.
Resolved by adding
<repository>
<id>netflix-candidates</id>
<name>Netflix Candidates</name>
<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
You can also change spring cloud version(2022.0.0-RC2) to
<spring-cloud.version>2021.0.3</spring-cloud.version>
And Spring version to <2.7.5>
Related
My work has its own maven server that it uses. Unfortunately, when I try to add a dependency to http://mvnrepository.com/artifact/commons-dbutils/commons-dbutils/1.6 it is not being found.
My question is how do I modify my settings.xml to allow for a 2nd server, which would be the mvnrepository, but only reference that server if the dependency isn't found on the main server?
Doing some search on stack overflow, I found the following answer to be useful: Do you know the maven profile for mvnrepository.com?
I did a combination of Tristan and Nicolas' answers, which let me add the following into my settings.xml:
<repository>
<id>maven repo</id>
<url>http://central.maven.org/maven2/</url>
<snapshots>
<enabled>false</endabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
Closed my project, reopened then reimported the maven dependences and all was good.
I am getting more and more comfortable with maven. But still some questions.
I have multiple <repository> in my pom.xml.
How will maven handle these repos when downloading artifacts? Will it search by the declaration order?
Besides the explicitly declared ones, will maven still check the default central repo at http://repo.maven.apache.org/maven2/?
If something cannot be found within the explicitly configured repo, will maven fallback to the default central repo?
Is it good to use multiple repos? I am kind of worried about inconsistency.
Below is the <repositories> section of my pom.xml:
<repositories>
<repository>
<id>ibiblio-central-repo</id>
<layout>default</layout>
<name>ibiblio-central-repo</name>
<releases>
<checksumPolicy>warn</checksumPolicy>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://maven.ibiblio.org/maven2/</url>
</repository>
<repository>
<id>oschina-central-repo</id>
<layout>default</layout>
<name>oschina-central-repo</name>
<releases>
<checksumPolicy>warn</checksumPolicy>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://maven.oschina.net/content/groups/public/</url>
</repository>
<repository>
<id>oschina-central-repo-3rd-party</id>
<layout>default</layout>
<name>oschina-central-repo-3rd-party</name>
<releases>
<checksumPolicy>warn</checksumPolicy>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>http://maven.oschina.net/content/repositories/thirdparty/</url>
</repository>
</repositories>
How will maven handle these repos when downloading artifacts? Will it
search by the declaration order?
Order of declaration as part of the merged settings (see next answer). I have found this JIRA ticket providing further details.
Besides the explicitly declared ones, will maven still check the
default central repo at http://repo.maven.apache.org/maven2/?
Yes, as it will be provided by the Maven super POM, implicit parent of all Maven Pom (here an official example), unless specified in your settings.xml (if you override the repository id specified in the super POM). You can use the Maven Help Plugin to get the effective settings Maven will apply to your build and the effective pom maven will actually (effectively) run.
As documented here, the repositories element is inherited.
If something cannot be found within the explicitly configured repo,
will maven fallback to the default central repo?
As above. Moreover, you could also influence this mechanism via any configured Maven mirror. You could, for instance, redirect Maven to your company repository (see below) instead of looking up on the default one.
Is it good to use multiple repos? I am kind of worried about
inconsistency.
You probably don't need many configured repositories, but you might need more than one if the dependencies you are looking for are not provided by the default repository. A good approach would be to have an enterprise Maven repository (i.e. Artifactory, Nexus) and make your local settings only point to it. Then, configure the internal Maven repository to point to other repositories, in a centralized (and governed) manner.
A quick question.
A am new to pom repositories.
I added this
<repository>
<id>tapx</id>
<name>howard lewisship snapshot repository</name>
<url>http://howardlewisship.com/snapshot-repository/</url>
</repository>
to pom file to get these files for tapestry project.
sha1 left and filename ont the right
7155233ba0dfbd99e19358f57e262ad484a440c6 tapx-core-1.1-20110620.210912-27.jar
822c300e6b6d93c53216d8d4fbb9b13217a7fb84 tapx-core-1.2-20110705.222421-4.jar
c11b3134128c3267f55dc4f8bfaab2f1f68ba711 tapx-datefield-1.1-20110617.214353-17.jar
ba2f05929baf2c01d22300953e983ac7a8f791b5 tapx-datefield-1.2-20110705.222544-4.jar
rebuild the index for added project repository
in eclipse when i enter sha1sum on the dependency searcher in eclipse i get 0 results.
Please tell me what i did wrong?
Enable snapshots; IIRC they're disabled by default.
<repository>
<id>tapx</id>
<name>howard lewisship snapshot repository</name>
<url>http://howardlewisship.com/snapshot-repository/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
Also see this super-POM reference info.
I am currently trying to add dojo as maven dependency in a web project.
I found this link: http://mvnrepository.com/artifact/org.dojotoolkit/dojo-maven/1.8.0
where I copied the dependency node into my POM.
Next I searched where the dojo-maven artefact lies (in which repository). But I cannot find this information. I tried adding:
<repository>
<id>maven2repo</id>
<url>http://central.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
But when I build it sais: Could not find artifact org.dojotoolkit:dojo-maven:jar:1.8.0 in maven2repo (http://central.maven.org/maven2/)
The dojo-maven artefact can be found here http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22dojo-maven%22
Another place to search can be here http://download.dojotoolkit.org/ under the maven category.
Can someone give me a hint?
Do you have a dependency defined in your pom?
<dependency>
<groupId>org.dojotoolkit</groupId>
<artifactId>dojo</artifactId>
<version>1.8.0</version>
</dependency>
This will only add the "compiled" dojo code. It is not the full SDK (with the build utilities, etc). There is an outstanding ticket to publish the full SDK to the maven repository.
http://bugs.dojotoolkit.org/ticket/15120
I'm defining a dependency in pom.xml in a Maven 3 project. Dependency is as follows:
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<scope>runtime</scope>
<version>2.2</version>
</dependency>
Repostory is described in pom as follows:
<repository>
<id>java.net</id>
<name>java.net</name>
<url>http://download.java.net/maven/2</url>
</repository>
Artifact is indeed present in the repository. It's easy to check. Despite that, Maven is trying to obtain the artifact from repo1.maven.org. What could be the reason of this? Maybe I make some crucial mistake in defining repository access? Other dependencies seem to do fine.
Plugin org.mortbay.jetty:maven-jetty-plugin:6.1.26 or one of its
dependencies could not be resolved: Could not find artifact
org.glassfish.web:el-impl:jar:2.2
in central (http://repo1.maven.org/maven2)
The repository that you have defined is used for dependencies, but not for plugins. Hence the error.
To address this, you need to define pluginRepositories:
<project>
<!-- ... -->
<pluginRepositories>
<pluginRepository>
<id>{repo.id}</id>
<url>{repo.url}</url>
</pluginRepository>
</pluginRepositories>
</project>
As to where you should specify - in pom.xml or settings.xml, read this SO post.
You need to check your maven settings.xml (Look into Maven folder: M2_HOME/conf).
The default repositories are defined there itself, and Maven central repository is taking precedence.
Define your repository in Maven's settings.xml like this:
<profiles>
<profile>
...
<repositories>
<repository>
<id>Java Net</id>
<name>Java Net</name>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
...
</pluginRepositories>
...
</profile>
You can maybe overwrite the default Maven central repository location with yours if you don't want to do much configuration.
Cheers!
In my case, the real root issue was that the repo required authentication. However for some reason maven decided that it would be much better to not tell me that, and to instead use the first repo in the <repositories> list, and throw the Could not find artifact error for that repo.
After moving the repo that contained the package so it was the first one in the <repositories> list, it started showing me a "permission denied" message. Once maven was setup for authentication with the repo in question, the issue went away.
I had a similar problem however, another developer had set up a mirror in that I simply copy-pasted into my settings.xml file. Modifying the mirrorOf property to only include specific repos did the trick.
In addition to the above mentioned answers, make sure your settings.xml is saved as an xml file not a text file i.e. its not saved settings.xml.txt.