无法执行目标org.eclipse.tycho:tycho-compiler-plugin:1.0.0

时间:2019-03-01 05:54:22

标签: java eclipse maven eclipse-plugin tycho

我正在尝试使用命令mvn clean install -X构建crs4gae,但得到org.apache.maven.lifecycle.LifecycleExecutionException。这是完整的堆栈跟踪:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project org.autorefactor.plugin.tests: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: copied.org.apache.maven.plugin.CompilationFailureException: Compilation failure
    at copied.org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:420)
    at org.eclipse.tycho.compiler.AbstractOsgiCompilerMojo.execute(AbstractOsgiCompilerMojo.java:293)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more

此异常背后的原因可能是什么? 这是POM文件(我更改了tycho的版本):

<?xml version="1.0" encoding="UTF-8"?>
<!-- | AutoRefactor - Eclipse plugin to automatically refactor Java code 
    bases. | | Copyright (C) 2014-2016 Jean-Noël Rouvignac - initial API and 
    implementation | | This program is free software: you can redistribute it 
    and/or modify | it under the terms of the GNU General Public License as published 
    by | the Free Software Foundation, either version 3 of the License, or | 
    any later version. | | This program is distributed in the hope that it will 
    be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty 
    of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General 
    Public License for more details. | | You should have received a copy of the 
    GNU General Public License | along with this program under LICENSE-GNUGPL. 
    If not, see | <http://www.gnu.org/licenses/>. | | | All rights reserved. 
    This program and the accompanying materials | are made available under the 
    terms of the Eclipse Public License v1.0 | which accompanies this distribution 
    under LICENSE-ECLIPSE, and is | available at http://www.eclipse.org/legal/epl-v10.html -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.autorefactor.plugin</groupId>
    <artifactId>parent</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <modules>
        <module>feature</module>
        <module>plugin</module>
        <module>samples</module>
        <module>plugin.tests</module>
        <module>repository</module>
    </modules>

    <properties>
        <tycho.scmUrl>scm:git:https://github.com/JnRouvignac/AutoRefactor.git</tycho.scmUrl>
        <tycho-repo.url>https://oss.sonatype.org/content/groups/public/</tycho-repo.url>
        <tycho-version>1.0.0</tycho-version>
    </properties>

    <repositories>
        <repository>
            <id>Mars</id>
            <layout>p2</layout>
            <url>http://download.eclipse.org/eclipse/updates/4.5</url>
            <!-- <id>Indigo</id> -->
            <!-- <layout>p2</layout> -->
            <!-- <url>http://download.eclipse.org/eclipse/updates/3.7</url> -->
            <!-- <id>Juno 3.8</id> <url>http://download.eclipse.org/eclipse/updates/3.8</url> 
                <id>Juno 4.2</id> <url>http://download.eclipse.org/eclipse/updates/4.2</url> 
                <id>Kepler</id> <url>http://download.eclipse.org/eclipse/updates/4.3</url> 
                <id>Luna</id> <url>http://download.eclipse.org/eclipse/updates/4.4</url> 
                <id>Mars</id> <url>http://download.eclipse.org/eclipse/updates/4.5</url> 
                <url>http://download.eclipse.org/releases/mars</url> -->
        </repository>

    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>tycho</id>
            <url>${tycho-repo.url}</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <!-- More information for Tycho based builds: http://wiki.eclipse.org/Tycho/Reference_Card 
                http://wiki.eclipse.org/Tycho/FAQ http://wiki.eclipse.org/Tycho/Packaging_Types 
                http://wiki.eclipse.org/Tycho/Migration_Howto http://wiki.eclipse.org/Category:Tycho 
                http://eclipse.org/tycho/documentation.php http://www.eclipse.org/tycho/sitedocs/index.html 
                http://www.eclipsecon.org/2013/sessions/building-eclipse-plug-ins-and-rcp-applications-tycho 
                https://github.com/jeffmaury/eclipsecon2013-tycho http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/ -->
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <pomDependencies>consider</pomDependencies>
                    <environments>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>macosx</os>
                            <ws>cocoa</ws>
                            <arch>x86_64</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>
            <!-- TODO JNR Read and apply: http://www.sebastianbauer.info/index.php?page=tutorials&which=justify 
                http://www.solutionsiq.com/developing-eclipse-plug-ins-program-to-publish/ 
                <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-surefire-plugin</artifactId> 
                <version>${tycho-version}</version> <configuration> <testSuite>Bundle-SymbolicName-of-bundleContaining-Tests</testSuite> 
                <testClass>FullyQualifiedNameOfTheTestClass</testClass> <parallel>classes|methods|both</parallel> 
                </configuration> </plugin> -->
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-compiler-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <source>1.6</source><!-- FIXME switch to 1.7 for RemoveUnnecessaryCastRefactoring -->
                    <target>1.6</target><!-- FIXME switch to 1.7 for RemoveUnnecessaryCastRefactoring -->
                    <compilerId>jdt</compilerId>
                    <!-- <compilerArgument>-err:nullAnnot,null</compilerArgument> <!- insert 
                        your warn/err configuration here -> <compilerArguments> <properties>${project.basedir}/.settings/org.eclipse.jdt.core.prefs</properties> 
                        </compilerArguments> -->
                </configuration>
                <dependencies>
                    <!-- This dependency provides the implementation of compiler "jdt": -->
                    <dependency>
                        <groupId>org.eclipse.tycho</groupId>
                        <artifactId>tycho-compiler-jdt</artifactId>
                        <version>${tycho-version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Set the new version with: mvn org.eclipse.tycho:tycho-versions-plugin:set-version 
                -DnewVersion=1.0 And tag with: git tag -a v1.0 -m "My message" -->
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-versions-plugin</artifactId>
                <version>${tycho-version}</version>
            </plugin>

        </plugins>

    </build>

    <!-- <profiles>
        <profile>
            <id>checkstyle</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.12.1</version>
                        <executions>
                            <execution>
                                <id>validate</id>
                                <phase>validate</phase>
                                <configuration>
                                    <configLocation>checkstyle.xml</configLocation>
                                    <encoding>UTF-8</encoding>
                                    <consoleOutput>true</consoleOutput>
                                    <failsOnError>true</failsOnError>
                                    <linkXRef>false</linkXRef>
                                </configuration>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles> -->
    <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
    <dependencies>
<dependency>
    <groupId>com.googlecode.json-simple</groupId>
    <artifactId>json-simple</artifactId>
    <version>1.1</version>
</dependency>
</dependencies>


</project>

0 个答案:

没有答案