2013-07-31 75 views
0

我已生成使用maven使用MVN原型項目struture生成一個Web應用程序:生成和項目結構如下: 的webapps -src - 主 -java -com -Web - App.java -test使用maven產生

我試圖鏈接create web app

運行MVN依賴於教程如下:分析-DEP-MGT

但仍然項目結構不同。

雖然我用這個 mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false,我得到POM文件丟失

我在哪裏犯錯,這樣不產生struture不同,我的web.xml?

C:\Users\user\workspace\webappspringapp\webapp>mvn dependency:analyze-dep-mgt 
[INFO] Scanning for projects... 
[ERROR] The build could not read 1 project -> [Help 1] 
[ERROR] 
[ERROR] The project com.webapp:webapp:1.0-SNAPSHOT (C:\Users\user\workspace\we 
bappspringapp\webapp\pom.xml) has 3 errors 
[ERROR]  'dependencies.dependency.version' for org.springframework:spring-cor 
e:jar must be a valid version but is '${spring.version}'. @ line 14, column 13 
[ERROR]  'dependencies.dependency.version' for org.springframework:spring-web 
:jar must be a valid version but is '${spring.version}'. @ line 20, column 13 
[ERROR]  'dependencies.dependency.version' for org.springframework:spring-web 
mvc:jar must be a valid version but is '${spring.version}'. @ line 26, column 13 

[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin 
gException 

pom.xml的一部分

<dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-core</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-web</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-webmvc</artifactId> 
      <version>${spring.version}</version> 
     </dependency> 
    <dependency> 
+0

嘗試從依賴-插件分析工具 尤其是MVN依賴性:分析-DEP-MGT –

+1

難道你'你的名稱進行替換MVN'{項目包裝}'和'{項目名稱}? – Ralph

+0

什麼是輸出(由mvn生成)?結構有何不同? – Ralph

回答

1
mvn dependency:tree 

這是用來查看目前在建項目的依賴性層次結構。它將輸出Maven構建過程實際使用的已解析的依賴關係樹。

+0

我試過了,它給了我一些版本上的錯誤。在我的問題上面記錄錯誤 –