2015-11-16 80 views
0

在我的本地機器上maven部署war到wildfly應用服務器成功使用mvn wildfly:deploy命令在ubuntu 14.10,maven 3.13和wildfly 8.2上,但是當我的夥伴嘗試在遠程服務器上部署get這個錯誤:maven-compiler-plugin 3.2編譯錯誤:找不到符號

... 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven- compiler-plugin:3.2:compile (default-compile) on project test1: Compilation failure: Compilation failure: 
[ERROR] /var/lib/jenkins/jobs/serviceProject/workspace/src/main/java/com/rest/counter/CountersBean.java:[6,17] cannot find symbol 
[ERROR] symbol: class LocalBean 
[ERROR] location: package javax.ejb 
[ERROR] /var/lib/jenkins/jobs/serviceProject/workspace/src/main/java/com/rest/counter/CountersBean.java:[10,2] cannot find symbol 
[ERROR] symbol: class LocalBean 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[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 read the following articles: 

的pom.xml

<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.test</groupId> 
    <artifactId>test1</artifactId> 
    <version>1.0</version> 
    <packaging>war</packaging> 
    <properties> 
     <jboss_home>{JBOSS_HOME}</jboss_home> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 


    <repositories> 
    <repository> 
     <id>JBoss repository</id> 
     <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url> 
    </repository> 
    </repositories> 

    <dependencies> 

    <dependency> 
     <groupId>javax.inject</groupId> 
     <artifactId>javax.inject</artifactId> 
     <version>1</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.ejb</groupId> 
     <artifactId>ejb-api</artifactId> 
     <version>3.0</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.enterprise</groupId> 
     <artifactId>cdi-api</artifactId> 
     <version>1.2</version> 
     <scope>provided</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.jboss.resteasy</groupId> 
     <artifactId>resteasy-jaxrs</artifactId> 
     <version>3.0.13.Final</version> 
     <scope>provided</scope> 
    </dependency> 

    ... 

    </dependencies> 

    <build> 
     <finalName>counterService</finalName> 
     <plugins> 
      <plugin> 
        <groupId>org.wildfly.plugins</groupId> 
         <artifactId>wildfly-maven-plugin</artifactId> 
         <version>1.1.0.Alpha4</version> 
         <configuration> 
           <jboss-home>{$jboss_home}</jboss-home> 
         </configuration> 
       </plugin> 

      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.2</version> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
    </plugins> 
    </build> 
</project> 

回答

1

你需要添加到您的pom.xml

<dependency> 
    <groupId>javax</groupId> 
    <artifactId>javaee-api</artifactId> 
    <version>7.0</version> 
</dependency>