1

Until now I was using Eclipse Indigo and m2eclipse. When wanted to create a new project I chose new maven project > skip archetype selection > gave names > finish.

This would result in a directory structure like : src/main/java src/main/resources src/test/java src/test/resources

and with the directory src/main/webapp including META-INF --MANIFEST.MF WEB-INF --web.xml

Recently (yesterday) I switched to the Eclipse Kepler. Maven is integrated, thus I didn't download m2eclipse wtp.

When I tried new project > maven project > skip archetype > naming > war packaging > finish , I got the correct structure in the src directory src/main/java src/main/resources src/test/java src/test/resources

But the directory webapp, was empty! META-INF and WEB-INF did not exist, no web.xml also. I read about using the maven-archetype-webapp, but i got the error: "Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\stef.m2\repository)"

With this article Failed to resolve version for org.apache.maven.archetypes

I found out that I had to add the remote maven catalog. I did and was able to create a project using the maven-archetype-webapp version 1.0 . But then the problem was that the directory structure in the new project was:

Java Resources --src/main/resources

and src/main/webapp --index.jsp --WEB-INF |--web.xml

I expected(and wanted) the old directory structure which was , src/main/java src/main/resources src/test/java src/test/resources

and with the directory src/main/webapp including META-INF --MANIFEST.MF WEB-INF --web.xml

Is there a step I am missinng? something changed in archetypes? Maybe it is a really stupid question, but my research returned very little results. Please feel free to any comment that can get me and other with the same issue, back in track

Thanks!

4

1 回答 1

1

在为原型发生了什么以及为什么它没有创建通常的结构而苦苦挣扎之后......我决定 - 作为一种生产力解决方法 - 创建一个新的 maven 项目并跳过原型创建。之后,我从一个旧项目中复制了 META-INF 和 WEB-INF 的目录,一切正常。我建议如果有人达到这一点,也可以这样做,以便继续前进,不再浪费时间。

如果有人知道解决方案,我将非常欢迎阅读它:)

于 2013-07-23T11:40:31.037 回答