How do I solve this "Missing artifact org.springframework:spring-core:jar:5.0.0.M5" - eclipse

am getting this error in my pom.xml file
Missing artifact org.springframework:spring-core:jar:5.0.0.M5
How do I solve this can anyone help me.
Thanks in advance.

The first answer is the correct one. you have to add the following repository to ur pom file.
<repositories>
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>

To resolve this probleme you need to add the right repository to your pom.xml
<repositories><repository><id>spring-milestone</id><name>Spring Milestone Repository</name><url>https://repo.spring.io/milestone</url></repository></repositories>

The issue here is maven was not able to download the jar. TO resolve this first locate your .m2 directory and traverse to org -springframework and delete the folder spring-core and then from your eclipse right click on the pom.xml and click on update project. It will again download the required dependency.

Related

Spring boot not compiling

I am trying to compile the project https://github.com/spring-cloud/spring-cloud-aws but the parent project has references to flatten-maven-plugin thus i am getting the error.
If this plugin is public i am not sure why i am getting the error as below. I am not able to get rid of this plugin. I opened a ticket on the git project but as it may not gather any answer.
Error resolving version for plugin 'org.codehaus.mojo:flatten-maven-plugin' from the repositories [local (C:\Users\ranajit.jana\.m2\repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository pom.xml /spring-cloud-aws-**** line 1 Maven pom Loading Problem
I am compiling this code as i want to make some changes.
Anyone has idea what can be done ?
=============================
This is resolved now.
This is was repo issue the plugin repo was pointing to repo1.maven.apache.org/maven2 which could not resolve this plugin.
I had to add the following to resolve this issue..
This is added as one additional plugin repo
<pluginRepository>
<id>maven-plugin-repo-mvn</id>
<name>Maven plugin repo maven</name>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
Open the .m2/repository and proceed to the path org/codehaus/mojo/flatten-maven-plugin/. There delete the subdirectory version number. and all contained files. Maven will automatically download them the next time they are required.

Resolve oltu openid connect dependency in maven

This is not a question but a simple maven dependency solution of oltu openid connect that I like to share. I found it might be helpful to other as there's not too many resource about it on the web.
I was having a problem with oltu openid connect dependency in maven (pom). Somehow I found its groupid, artifact, and its version. But whenever I insert the dependency in pom, eclipse notifies me with missing artifact. The problem seemed like this:
The problem was as above mentioned that the dependency was not available in maven central repository. As I searched through web, I found those dependencies are hosted in other repository which is http://repository.idega.com/maven2/. After that, the solution was just to include this repository in your pom like shown below:
Try using the Apache Snapshot Repository:
<repositories>
<repository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>

Finding missing Maven artifacts

I'm new to Maven, and struggling with adding dependencies. I'm trying to convert an existing project to Maven, and after adding the dependencies for all the jars in my referenced libraries, I'm receiving an error message about missing artifacts:
Missing artifact stax:stax:jar:1.0
Missing artifact clover:clover:jar:1.3-rc4
Missing artifact log4j:log4j:bundle:1.2.16
Missing artifact stax:stax-ri:jar:1.0
From reading this post: How to handle Maven missing artifact errors?, it sounds like I need to manually download these jars and add them to my local maven repository. My question is how do I find these jars? I tried googling them, and I can find jars that have similar names, but not exactly like these, so I'm not sure if they're the right jars.
Any tips for dealing with this problem? The log4j jar is the only one explicitly listed in the referenced libraries of my original project, so I'm guessing the other ones are required by other jars that I have, and I don't know where to find them or what their exact names should be.
Thanks!
Thanks to everyone for responding. The actual cause of the problem is that for each of those 3 missing artifacts, for some reason, when Maven downloaded them into my local repository, .lastUpdated was appended to the end of the jar. For example, stax-1.0.jar.lastUpdated. This is the reason Maven could not find stax-1.0.jar.
So, to fix this problem, I had to manually download stax-1.0.jar, then install it into the local maven repository in the exact same place as the messed up file, so that Maven could find it. (For example, using the command:
mvn install:install-file -Dfile=<path-to-file>/stax-1.0.jar
-DgroupId=stax -DartifactId=stax -Dversion=1.0 -Dpackaging=jar
Using the same exact groupId and artifactId as the existing, incorrect file was crucial in order for maven to find it.
You can find dependency search Sites under maven.apache.org. Go to the left side Navigation MenĂ¼ entry FAQ (official) and Thun to end of page.
It's more likely that your POM definition is not correct for log4j. Everything relating to log4j should be readily available in maven.
Also, if you know the name of the bundle (such as log4j) you can almost always do a quick google search "[bundle name] maven pom" within the first few hits you should either get the maven repo containing a quick snippet on how to include it, or the actual website for the bundled up jar and the maven instructions.
For example log4j:
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
Sometimes though you just need to specify the repository to find the item in (if it's not hosted in the greater maven repositories)
You can specify a new repository like so
<repositories>
<repository>
<id>Java.Net</id>
<url>http://download.java.net/maven/2/</url>
</repository>
</repositories>
Finally when you absolutely cannot find the artifact already maven'd up for you (this is usually true for proprietary jars and or drivers that you cannot include with your project) you can have the user manually install the item via command line
mvn install:install-file -DgroupId=[group-id] -DartifactId=[artifact-id] -Dversion=[version] -Dfile=/path/to/the/file -Dpackaging=[type]
You can then reference it in your maven file using the information described above
For example I have a custom reference for a salesforce.com project
mvn install:install-file -DgroupId=com.salesforce -DartifactId=wsc -Dversion=22 -Dfile=\tsclient\H\development\java\wsc-22.jar -Dpackaging=jar
To access it in maven:
<dependency>
<groupId>com.salesforce</groupId>
<artifactId>wsc</artifactId>
<version>22</version>
</dependency>
Finally, you can find the jars (or their maven info) at their respective websites (please note I'm just basing these links off the jar names, these may not be the actual websites, well sans the log4j which I know to be correct)
Stax
Clover
Log4j
Use maven search or mvnrepository.com. If you can not find use google looking for jar in other public repositories, for example for stax:
maven stax-ri pom
My first result is:
http://maven.nuxeo.org/nexus/content/groups/public/stax/stax-ri/1.0/
Other public repositories:
http://download.java.net/maven/2
http://download.java.net/maven/1
http://repository.codehaus.org
http://repository.jboss.org/nexus/content/groups/public-jboss
http://maven.springframework.org/release
you can try to add new repositories to your pom.xml
<repositories>
<repository>
<id>java.net</id>
<url>http://download.java.net/maven/2/</url>
</repository>
<repository>
<id>jboss</id>
<url>http://repository.jboss.com/maven2</url>
</repository>
</repositories>
After several days this stupid error bugged me, I found the following article
The author describes that there is a workspace repository, which may out of date. In my case it helped just to import the correct plugins again. The workspace repository has been updated and everything is fine.
Your problem might be something to do with MNG-4142. This bug means that maven will not download a new snapshot if localCopy is set to true in the artifact maven-metadata-local.xml.
Note that the title of this bug is slightly misleading so it is work reading the comments.
You might think that using the -U flag with maven would fix this problem but apparently this is not the case.
The current workaround seems to be searching for all instances of maven-metadata-local.xml and changing the value of localCopy to false.
I solved this problem by changing the log4j version from 1.2.15 to 1.2.16.
It also could be cause by the dom4j. The same error occurred when I use the following settings.
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>20040902.021138</version>
</dependency>
After changing to the following, the error disappeared.
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>

Unable to update EclipseLink with M2Eclipse

I am using Eclipse with Maven (using m2eclipse) and attempting to add the EclipseLink repository.
Within my pom.xml I have set the following:
<repositories>
<repository>
<id>eclipselink</id>
<url>http://www.eclipse.org/downloads/download.phpr=1&nf=1&file=/rt/eclipselink/maven.repo</url>
</repository>
</repositories>
I then navigate to the Maven Repository Window and right click the repository and select Full Index Enabled.
This results in the following message being displayed:
4/23/11 1:45:53 PM BST: Updating index eclipselink|http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
4/23/11 1:45:54 PM BST: Unable to update index for eclipselink|http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
Any help in solving this problem would be appreciated.
If you call that page you will get an 404 page not found...so the url must be wrong.
There may not be anything to worry. It is possible that Eclipselink repository is not having a repository index file which is requested by m2eclipse.
What is important is to check if dependencies specified in your pom, present in Eclipselink repository are getting downloaded correctly.
You have a typo in URL:
It should be:
http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
You missed question mark.
Source:
Can't find the "org.eclipse.persistence" Maven dependency

building spring batch sample application

I am trying to build the sample application for spring batch 2.1.6. (ie. spring-batch-2.1.6.RELEASE/samples/spring-batch-samples) using maven but am getting this error for a missing plugin:
[ERROR] Plugin
com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE
or one of its dependencies could not be resolved: Failure to find
com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE
in http://repo1.maven.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 ->
Is there another repository I can set up to get this plugin? I am a bit suprised to be getting this errror as this is the latest realease version of spring batch.
Here is the repository section from the pom as it came in the download:
<repositories>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle External</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
The project's parent pom has a bootstrap profile which contains the necessary repository definitions. Build the project with the command mvn test -P bootstrap and it will download the dependencies.
P.S. This is explained in the readme's instructions that how to build Spring Batch. It would be good if they would also tell how to do it in the instructions for using the samples - maybe you could file a bug report?
i am using maven3 and was able to solve this problem by adding this to my pom:
<pluginRepositories>
<pluginRepository>
<id>plugin.repo.maven.central2</id>
<url>http://objectstyle.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The Spring batch Admin sample build is broken for sure. At least as of today.
The -Pbootstrap doesn't help and adding the repos in that profile in my local settings doens't help either.
When I attempted to build spring-batch-admin-sample, I found that I was missing dependencies of spring batch!
So I went to build that. There I found that I was missing org.neo4j:neo4j-cypher-dsl-1.9.M04 and also gemfire.7.0.1.jar. Adding repos doesn't help because of the maven2/3 incompatibility issues.
So a sure way to fix this is to go to each repo, download the missing dep and mvn install-file them.
So get the neo4j one here:
http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/
Get the gemfire one from here:
https://repo.springsource.org/gemstone-release-cache/com/gemstone/gemfire/gemfire/7.0.1/
And then I ran into a foundrylogic.vpp dependency that I found here:
http://objectstyle.org/maven2/foundrylogic/vpp/vpp/2.2.1/
Don't forget to get the corresponding poms also to keep it clean and get all the transitives, if any.
Use the mvn install-file plugin described here to get all three deps to your local repo.
http://maven.apache.org/plugins/maven-install-plugin/usage.html
Now spring-batch should build clean.
Now if you go to build spring-batch-admin it will still fail because it depends on spring-batch-core-2.2.3.BUILD-SNAPSHOT whereas what we just built was version 3.0.0.BUILD-SNAPSHOT.
So go to spring-batch-admin-parent's pom and modify the pom like so:
<!-- <spring.batch.version>2.2.3.BUILD-SNAPSHOT</spring.batch.version> -->
<spring.batch.version>3.0.0.BUILD-SNAPSHOT</spring.batch.version>
And then step back to spring-batch-admin and mvn clean install should build the sample.
Hope this helps someone!
I installed maven 3.2.1 and it works.