Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to create spring-mvc project in STS

I am trying to create a spring mvc project. I am creating a Maven project and then selecting the archetypes as

GroupId : co.ntier
ArtifactId : spring-mvc-archetype
Version: 1.0.2

I am getting this error:

Unable to create project from archetype [co.ntier:spring-mvc-archetype:1.0.2 -> http://maven-repository.com/artifact/co.ntier/spring-mvc-archetype/1.0.2]
The defined artifact is not an archetype
like image 251
DTnapaT Avatar asked Aug 22 '14 20:08

DTnapaT


People also ask

Can we create Spring MVC project in STS?

Creating Spring MVC Application in STS or EclipseStep 1: Create New Spring Project from the menu. Step 2: In the new project window, give the name as “SpringMVCExample” and chose template as “Spring MVC Project”. If you are using this template for the first time, STS will download it from SpringSource website.

Which dependency required for Spring MVC?

Spring MVC Dependencies to pom. We need to add spring-web and spring-webmvc dependencies in pom. xml, also add servlet-api, jsp-api and jstl dependencies.


2 Answers

Try cleaning up your .m2\repository\ folder. Don't forget to set your proxy in settings.xml. settings.xml is manually created therefore you need to make your own and set the proxy. Here's a sample template for setting up your proxy inside settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host> --your proxy here-- </host>
      <port> --your port no here-- </port>
    </proxy>
  </proxies>
</settings>

When you make a new Maven Project and add a new archetype, use this Repository URL instead: http://repo1.maven.org/maven2/

By the way I'm using Eclipse Luna and it works on my end.

like image 181
javaMaster Avatar answered Sep 24 '22 04:09

javaMaster


In my case i have only change repository URL. try with this url:http://repo.maven.apache.org/maven2/

like image 42
ErSyyedS Avatar answered Sep 23 '22 04:09

ErSyyedS