执行失败:'控制构建' &安培;无法执行目标:maven-compiler

时间:2014-12-09 22:17:17

标签: maven spring-mvc jboss compiler-errors openshift

我的项目在本地工作,它在3-4小时前也在服务器上工作。我做了一个很大的提交,现在它搞砸了。我已经解决了很多错误消息,这就是剩下的。我正在使用“force_clean_build”标记,因此服务器会在推送过程中下载所有的jar,但是在推送之后git bash说:

remote: [INFO] Compiling 30 source files to /var/lib/openshift/547b2214e0b8cd9044g83940/app-root/runtime/repo/target/classes
remote: [INFO] -------------------------------------------------------------
remote: [ERROR] COMPILATION ERROR :
remote: [INFO] -------------------------------------------------------------
remote: [ERROR] /var/lib/openshift/547b2214e0b8cd9044g83940/app-root/runtime/repo/src/main/java/com/mvcproject/RowMapper/UserRowMapper.java:[4,53] error: package com.sun.xml.internal.bind.v2.schemagen.episode does not exist
remote: [INFO] 1 error
remote: [INFO] -------------------------------------------------------------
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] BUILD FAILURE
remote: [INFO] ------------------------------------------------------------------------
remote: [INFO] Total time: 31.508s
remote: [INFO] Finished at: Tue Dec 09 16:30:41 EST 2014
remote: [INFO] Final Memory: 13M/142M
remote: [INFO] ------------------------------------------------------------------------
remote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:2.3.2:compile (default-compile) on project javaproject: Compilation failure
remote: [ERROR] /var/lib/openshift/547b2214e0b8cd9044g83940/app-root/runtime/repo/src/main/java/com/mvcproject/RowMapper/UserRowMapper.java:[4,53] error: package com.sun.xml.internal.bind.v2.schemagen.episode does not exist
remote: [ERROR] -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the following articles:
remote: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/547b2214e0b8cd9044g83940/jbossews
remote:
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://547b2214e0b8cd9044g83940@javaproject-mydomain.rhcloud.com/~/git/javaproject.git/639492e..ff379cc  master -> master 

我不知道“com.sun.xml.internal.bind.v2.schemagen.episode”或“gear postreceive”是什么。 UserRowMapper在此之前已经工作过了。我还在本地删除了我的.m2文件夹,但是没有弄清楚它在服务器上的位置,但我猜“强制清理构建”会做到这一点吗?

我的pom.xml没有依赖项(因为它们太多了)看起来像这样:

<repositories>
    <repository>
        <id>eap</id>
        <url>http://maven.repository.redhat.com/techpreview/all</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>eap</id>
        <url>http://maven.repository.redhat.com/techpreview/all</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>
<properties>
    <spring.version>4.0.0.RELEASE</spring.version>
    <spring.security.version>3.2.1.RELEASE</spring.security.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

... dependecies ....

<profiles>
    <profile>
        <id>openshift</id>
        <build>
            <finalName>javaproject</finalName>
            <plugins>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <outputDirectory>webapps</outputDirectory>
                        <warName>ROOT</warName>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

<build>
    <finalName>javaproject</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.15</version>
            <configuration>
                <includes>
                    <include>**/*Tests.java</include>
                </includes>
            </configuration>
        </plugin>
    </plugins>
</build>

1 个答案:

答案 0 :(得分:1)

我承认我对Java并不了解,但看起来你错过了pom.xml中的依赖关系。编译抱怨的包看起来像是由jaxb-osgi提供的:

http://mvnrepository.com/artifact/com.sun.xml.bind/jaxb-osgi/2.2.1

基本上将以下内容添加到您的pom.xml:

<dependency>
  <groupId>com.sun.xml.bind</groupId>
  <artifactId>jaxb-osgi</artifactId>
  <version>2.2.1</version>
</dependency>