Maven: pom.xml, не может разрешить пакет - PullRequest
0 голосов
/ 15 декабря 2011

Я пытаюсь построить проект, используя maven в непрерывной интеграции Jenkins, для этого я написал pom.xml, включив в него все необходимые файлы jar, которые я написал так:следующие ошибки '

[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

Ответы [ 2 ]

2 голосов
/ 15 декабря 2011

Я пытаюсь построить проект, используя maven в непрерывной интеграции Jenkins

Делай один шаг за раз. Сначала попытайтесь заставить его работать локально с maven, затем попробуйте то же самое в Jenkins.

Если у вас есть проблемы с зависимостями, mvn dependency:list и mvn dependency:tree могут быть очень полезны. Здесь важно учитывать границы зависимостей.

Я вижу странный <scope>main/<scope> в вашем pom.xml, это, вероятно, проблема. См. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope для получения документации по областям применения.

0 голосов
/ 16 декабря 2011

Я мог бы решить проблему, изменив pom следующим образом

    <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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <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>test</scope>
    </dependency>
   <dependency>
      <groupId>ibatis</groupId>
       <artifactId>ibatis-common</artifactId>
       <version>2.0</version>
       <scope>system</scope>
      <systemPath>D:\MavenRepos\ibatis\ibatis-common\2.0\ibatis-common-2.0.jar</systemPath>
  </dependency>
    <dependency>
      <groupId>org.apache.ibatis</groupId>
       <artifactId>ibatis-sqlmap</artifactId>
       <version>2.0</version>       
       <scope>system</scope>
       <systemPath>D:\MavenRepos\org\apache\ibatis\ibatis-sqlmap\2.0\ibatis-sqlmap-2.0.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-management</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>    
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>2.1.8</version>
       <scope>system</scope>
      <systemPath>D:\MavenRepos\repository\org\apache\struts\struts2-core\2.1.8\struts.jar</systemPath>
    </dependency>
  </dependencies>
  <build>
    <finalName>jk-ex-3-POM</finalName>
  </build>
</project>
...