我想開始一個新的Struts 2的項目使用maven(Struts2的空白原型) 下方運行的代碼和致命錯誤與它的pom.xml一起生成項目的Maven上的struts2-原型空白
D:\Dev\IndigoWS>mvn archetype:generate -B DgroupId=com.proj.core -DartifactId=MyStruts2Blank -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-ar
chetype-blank -DarchetypeVersion=2.2.1
與終端的以下堆棧跟蹤。
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Batch mode
[INFO] Archetype repository missing. Using the one from [org.apache.struts:strut
s2-archetype-blank:2.2.3] found in catalog remote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
但每當我嘗試使用命令
mvn eclipse:eclipse -Dwtpversion=1.5
我遇到下面
d的致命錯誤將其轉換成一個Eclipse項目:\開發\ MyWorkspace> CD MyStruts2Blank
D:\ Dev \ MyWorkspace \ MyStruts2Blank> mvn eclipse:eclipse -Dwtpversion = 1 .5
[INFO]掃描項目... [INFO] ------------------------------- -------------------------------------------------- [錯誤]致命錯誤
[INFO] --------------------------------------- -------------------------------------------------- ------------------------------- [INFO]構建POM時出錯(可能不是此項目的POM)。項目號:com.proj.core:MyStruts2Blank POM位置: d:\開發\ MyWorkspace \ MyStruts2Blank \的pom.xml
pom.xml中
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.royj.core</groupId>
<artifactId>MyStruts2Blank</artifactId>
<version>${project.version}</version>
<packaging>war</packaging>
<name>Struts 2 Blank Webapp</name>
<properties>
<struts2.version>${project.version}</struts2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${struts2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
<scanTarget>src/main/resources/example.xml</scanTarget>
</scanTargets>
</configuration>
</plugin>
</plugins>
</build>
</project>
和行家版本
Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_24
Java home: C:\Program Files\Java\jdk1.6.0_24\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
我需要做些什麼來解決這個問題,併成功地生成一個struts 2空白原型。我可以使用maven成功地爲struts 2創建初學者原型,但對於空白原型沒有成功。空白原型不再可用?順便說一下我使用的是Eclipse Indigo版本:Indigo,發佈版本號:20110615-0604 在此先感謝你們。
你有沒有通過這個http://struts.apache.org/2.2.3/docs/struts-2-blank-archetype.html? – 2012-03-28 10:12:08
哪個eclipse版本,哪個Maven版本?你可以發佈POM嗎? – khmarbaise 2012-03-28 14:52:31
@UmeshAwasthi我已經編輯我的問題,其中包括順便pom.xml中,我使用Eclipse靛藍 版本:靛藍髮行 版本ID:20110615-0604 – royjavelosa 2012-03-29 01:13:38