我想建立使用Maven的詹金斯持續集成爲我寫的pom.xml包含在項目中的所有所需的JAR文件我的聚甲醛是如下Maven的:pom.xml中,無法解析包
<modelVersion>4.0.0</modelVersion>
<repositories>
<repository>
<id>central</id>
<name>My Company's Internal Repository</name>
<layout>default</layout>
<url>file:///D:/MavenRepos/</url>
</repository>
</repositories>
<groupId>codon</groupId>
<artifactId>Struts2OfficeExpenses</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Struts2Office Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
<scope>main</scope>
</dependency>
<dependency>
<groupId>ibatis</groupId>
<artifactId>ibatis-common</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ibatis</groupId>
<artifactId>ibatis-sqlmap</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>geronimo</groupId>
<artifactId>geronimo-management</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>main</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8</version>
<scope>main</scope>
</dependency>
</dependencies>
<build>
<finalName>Struts2OfficeExpenses</finalName>
</build>
</project>
但還是我收到以下錯誤 '
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[9,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[10,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[11,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[12,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[13,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[17,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[18,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[19,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[20,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[25,32] cannot find symbol
symbol: class Action
public class FromAction extends Action {
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[30,31] cannot find symbol
symbol : class ActionMapping
location: class main.java.com.codon.user.action.FromAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[30,48] cannot find symbol
symbol : class ActionForm
location: class main.java.com.codon.user.action.FromAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[30,62] cannot find symbol
symbol : class HttpServletRequest
location: class main.java.com.codon.user.action.FromAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[30,85] cannot find symbol
symbol : class HttpServletResponse
location: class main.java.com.codon.user.action.FromAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[30,9] cannot find symbol
symbol : class ActionForward
location: class main.java.com.codon.user.action.FromAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\FromAction.java:[30,116] cannot find symbol
symbol : class ServletException
location: class main.java.com.codon.user.action.FromAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[8,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[9,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[10,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[11,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[12,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[16,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[17,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[18,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[19,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[25,34] cannot find symbol
symbol: class Action
public class UpdateAction extends Action {
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[30,31] cannot find symbol
symbol : class ActionMapping
location: class main.java.com.codon.user.action.UpdateAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[30,48] cannot find symbol
symbol : class ActionForm
location: class main.java.com.codon.user.action.UpdateAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[30,62] cannot find symbol
symbol : class HttpServletRequest
location: class main.java.com.codon.user.action.UpdateAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[30,85] cannot find symbol
symbol : class HttpServletResponse
location: class main.java.com.codon.user.action.UpdateAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[30,9] cannot find symbol
symbol : class ActionForward
location: class main.java.com.codon.user.action.UpdateAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\UpdateAction.java:[30,116] cannot find symbol
symbol : class ServletException
location: class main.java.com.codon.user.action.UpdateAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[3,0] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[7,0] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[8,0] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[14,34] cannot find symbol
symbol: class Action
public class LogoutAction extends Action {
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[16,30] cannot find symbol
symbol : class ActionMapping
location: class main.java.com.codon.user.action.LogoutAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[17,3] cannot find symbol
symbol : class ActionForm
location: class main.java.com.codon.user.action.LogoutAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[17,19] cannot find symbol
symbol : class HttpServletRequest
location: class main.java.com.codon.user.action.LogoutAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[18,3] cannot find symbol
symbol : class HttpServletResponse
location: class main.java.com.codon.user.action.LogoutAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[16,8] cannot find symbol
symbol : class ActionForward
location: class main.java.com.codon.user.action.LogoutAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LogoutAction.java:[18,39] cannot find symbol
symbol : class ServletException
location: class main.java.com.codon.user.action.LogoutAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[8,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[9,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[10,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[11,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[15,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[16,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[17,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[18,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[24,33] cannot find symbol
symbol: class Action
public class LoginAction extends Action {
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[29,31] cannot find symbol
symbol : class ActionMapping
location: class main.java.com.codon.user.action.LoginAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[29,48] cannot find symbol
symbol : class ActionForm
location: class main.java.com.codon.user.action.LoginAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[29,62] cannot find symbol
symbol : class HttpServletRequest
location: class main.java.com.codon.user.action.LoginAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[29,85] cannot find symbol
symbol : class HttpServletResponse
location: class main.java.com.codon.user.action.LoginAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[29,9] cannot find symbol
symbol : class ActionForward
location: class main.java.com.codon.user.action.LoginAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\LoginAction.java:[29,116] cannot find symbol
symbol : class ServletException
location: class main.java.com.codon.user.action.LoginAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\AddFormBean.java:[2,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\AddFormBean.java:[3,33] cannot find symbol
symbol: class ActionForm
public class AddFormBean extends ActionForm{
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[8,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[9,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[10,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[11,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[15,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[16,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[17,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[18,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[24,32] cannot find symbol
symbol: class Action
public class ReadToList extends Action {
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[29,31] cannot find symbol
symbol : class ActionMapping
location: class main.java.com.codon.user.action.ReadToList
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[29,48] cannot find symbol
symbol : class ActionForm
location: class main.java.com.codon.user.action.ReadToList
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[29,62] cannot find symbol
symbol : class HttpServletRequest
location: class main.java.com.codon.user.action.ReadToList
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[29,85] cannot find symbol
symbol : class HttpServletResponse
location: class main.java.com.codon.user.action.ReadToList
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[29,9] cannot find symbol
symbol : class ActionForward
location: class main.java.com.codon.user.action.ReadToList
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\ReadToList.java:[29,116] cannot find symbol
symbol : class ServletException
location: class main.java.com.codon.user.action.ReadToList
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[8,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[9,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[10,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[11,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[12,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[16,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[17,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[18,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[19,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[25,34] cannot find symbol
symbol: class Action
public class DeleteAction extends Action {
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[30,31] cannot find symbol
symbol : class ActionMapping
location: class main.java.com.codon.user.action.DeleteAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[30,48] cannot find symbol
symbol : class ActionForm
location: class main.java.com.codon.user.action.DeleteAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[30,62] cannot find symbol
symbol : class HttpServletRequest
location: class main.java.com.codon.user.action.DeleteAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[30,85] cannot find symbol
symbol : class HttpServletResponse
location: class main.java.com.codon.user.action.DeleteAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[30,9] cannot find symbol
symbol : class ActionForward
location: class main.java.com.codon.user.action.DeleteAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\DeleteAction.java:[30,116] cannot find symbol
symbol : class ServletException
location: class main.java.com.codon.user.action.DeleteAction
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[9,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[10,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[11,20] package javax.servlet does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[12,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[13,25] package javax.servlet.http does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[17,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[18,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[19,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[20,31] package org.apache.struts.action does not exist
D:\Projects\Jenkins-struts\src\main\java\com\codon\user\action\PurposeAction.java:[26,35] cannot find symbol
symbol: class Action
public class PurposeAction extends Action {
' 請指導我.. enter code here
感謝您的答覆沃特·我已經改變了範圍,因爲編譯解決這個問題,並嘗試在本地Maven甚至還有我得到同樣的錯誤運行 – harini 2011-12-15 12:45:45