kramsiv1234
kramsiv1234

Reputation: 123

Cannot create a new Maven project in eclipse

When I try to create a new Maven project, this error occurs:

Could not resolve archetype org.apache.maven.archetype:maven-archetype-quickstart:1.1 from any of the configured repositories.

Additionally, I get the following message:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories. Could not write artifact lastUpdated status /Users/vismarkjuarez/.m2/repository/org/apache/maven/archetypes/maven-archetype-quickstart/1.1/m2e-lastUpdated.properties (No such file or directory)

I've tried deleting my entire .m2 folder but can't do so (cannot delete non-empty directory error), and I've already gone ahead and deleted my .m2/repository/org/apache/maven/archetypes folder, but the same error occurs.

Upvotes: 0

Views: 3374

Answers (2)

Ankit Rauthan
Ankit Rauthan

Reputation: 80

I know that this is an old problem but still there is no accepted answer for this problem,So I'll answer it just in case somebody stumble on this problem like me.

So the issue here is that maven is not downloading latest jar and pom file for the dependencies in your case arhetype. The thing is maven tries to download it but failed and hence inside those folders you see pom and jar file with last downloaded type.So the solution is pretty simple.

  1. First go inside your .m2 folder i.e. C/Users/username/.m2/repository

  2. Now delete everything inside repository folder i.e. org and everything inside it

  3. Now go to https://github.com/sofastack/sofa-rpc/pull/190/files , copy tools/ci/.travis.settings.xml .

  4. Now open notepad++ , create a new file,paste the above copy file and saved it as settings.xml

  5. Now place your settings.xml inside C/Users/username/.m2

  6. Now open eclipse :- Click Window>Preferences>Maven>User Settings

  7. Now browse your User Settings file and give them the path of your settings.xml i.e. C/Users/username/.m2/settings.xml

  8. Now Apply the changes and start again you'll see that the dependencies will now start getting downloaded instead of creating lastdownloaded files.

Upvotes: 1

Francisco Marin
Francisco Marin

Reputation: 21

I had this problem and resolved this way:

In Eclipse, Menu Windows->Option Preferences->Open Maven->User Settings

Go to address specified in Local Repository(From merged user and global settings) and delete all folders and files. Now you can create your project with no problems.

Upvotes: 2

Related Questions