maven - 执行失败 : 'control build' & Failed to execute

我的项目在本地工作,并且在 3-4 小时前也在服务器上工作。我做了一个大的 promise ,现在它搞砸了。我已经解决了很多错误消息,这就是剩下的。我正在使用“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>

最佳答案

我承认我对 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>

关于maven - 执行失败 : 'control build' & Failed to execute goal: maven-compiler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27389920/

相关文章:

compiler-errors - Latex中缺少\begin {document}

android - 关于主要 Activity : 'illegal start of expres

objective-c - 隐式转换为NSIndexPath的错误

compiler-errors - 无法解决错误,VHDL,语法错误,但我看不到

actionscript-3 - for(const i)而不是(var i)

c# - 如何从 C# 中的封闭构造类中获取基类对象

caching - 如何处理并发Web用户的重置CS-Script

c# - 抑制ASPX文件的生成错误

android - Android Delphi xe7中的错误

compilation - 如何在Windows上的SCons中导出具有备用扩展名的程序