web-dev-qa-db-ja.com

ゴールmaven-compiler-plugin3.8.0の実行に失敗しました-org / codehaus / plexus / compiler / manager / NoSuchCompilerException

jDK1.8でMaven3.5.3を使用しています。 cmdからコンパイルしようとすると、プロジェクトはmvn clean compile、コンソールは次のエラーを返します。

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< com.dadopay:DadopayDAOAggregator >------------------
[INFO] Building DadopayDAOAggregator 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ DadopayDAOAggregator ---
[INFO] Deleting C:\Users\..\Documents\Workspace\Dadopay_DAO_Aggregator\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ DadopayDAOAggregator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ DadopayDAOAggregator ---
[WARNING] Error injecting: org.Apache.maven.plugin.compiler.CompilerMojo
Java.lang.NoClassDefFoundError: org/codehaus/plexus/compiler/manager/NoSuchCompilerException
   ...
    Caused by: Java.lang.ClassNotFoundException: org.codehaus.plexus.compiler.manager.NoSuchCompilerException
  ...
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 13.753 s
    [INFO] Finished at: 2018-10-30T12:02:58+01:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.Apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project DadopayDAOAggregator: Execution default-compile of goal org.Apache.maven.plugins:maven-compiler-plugin:3.8.0:compile failed: A required class was missing while executing org.Apache.maven.plugins:maven-compiler-plugin:3.8.0:compile: org/codehaus/plexus/compiler/manager/NoSuchCompilerException
    [ERROR] -----------------------------------------------------
    [ERROR] realm =    plugin>org.Apache.maven.plugins:maven-compiler-plugin:3.8.0
    [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
    [ERROR] urls[0] = file:/../.m2/repository/org/Apache/maven/plugins/maven-compiler-plugin/3.8.0/maven-compiler-plugin-3.8.0.jar
    [ERROR] urls[1] = file:/../.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
    [ERROR] urls[2] = file:/../.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
    [ERROR] urls[3] = file:/../.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
    [ERROR] urls[4] = file:/../.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
    [ERROR] urls[5] = file:/../.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
    [ERROR] urls[6] = file:/../.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7.1/plexus-component-annotations-1.7.1.jar
    [ERROR] urls[7] = file:/../.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
    [ERROR] urls[8] = file:/../.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
    [ERROR] urls[9] = file:/../.m2/repository/org/Apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar
    [ERROR] urls[10] = file:/../.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
    [ERROR] urls[11] = file:/../.m2/repository/org/Apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
    [ERROR] urls[12] = file:/../.m2/repository/org/codehaus/plexus/plexus-Java/0.9.10/plexus-Java-0.9.10.jar
    [ERROR] urls[13] = file:/../.m2/repository/org/ow2/asm/asm/6.2/asm-6.2.jar
    [ERROR] urls[14] = file:/../.m2/repository/com/thoughtworks/qdox/qdox/2.0-M9/qdox-2.0-M9.jar
    [ERROR] urls[15] = file:/../.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.8.4/plexus-compiler-api-2.8.4.jar
    [ERROR] urls[16] = file:/../.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.8.4/plexus-compiler-manager-2.8.4.jar
    [ERROR] urls[17] = file:/../.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.8.4/plexus-compiler-javac-2.8.4.jar
    [ERROR] Number of foreign imports: 1
    [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
    [ERROR]
    [ERROR] -----------------------------------------------------
    [ERROR] : org.codehaus.plexus.compiler.manager.NoSuchCompilerException
    [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:
    [ERROR] [Help 1] http://cwiki.Apache.org/confluence/display/MAVEN/PluginContainerException

私の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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.dadopay</groupId>
    <artifactId>DadopayDAOAggregator</artifactId>
    <version>1.0.0</version>
    <name>DadopayDAOAggregator</name>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.Apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <scope>test</scope>
                    </configuration>

                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.3.1RELEASE</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>4.3.1RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.3.1RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.Apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.8.1</version>
        </dependency>

        <dependency>
            <groupId>com.Oracle</groupId>
            <artifactId>ojdbc14</artifactId>
            <version>10.2.0.3.0</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
            <exclusions>
                <exclusion>
                    <artifactId>xercesImpl</artifactId>
                    <groupId>xerces</groupId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

thisthis ;のような投稿はすでに見ました。すべての.m2フォルダーを削除し、pom内のソースを変更して、URLとして報告されたすべてのjarがリポジトリに存在するかどうかを確認しようとしました(すべてがそこにありました)。

ありがとうございました

[〜#〜]編集[〜#〜]-mvn -v結果:

Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: C:\Program Files\maven\bin\..
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_171\jre
Default locale: it_IT, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", Arch: "AMD64", family: "windows"

私のプロジェクト構造:

src
   main
        Java
             it.noatel.data_access.bean
             it.noatel.data_access.dao
             it.noatel.data_access.commons
             it.noatel.data_access.dao.impl.jdbc
             it.noatel.data_access.dao.impl.commons
             it.noatel.data_access.util
3
el fuser

最善の方法は、ディスクを完全にクリーンアップし、 ここ から最後のバージョン(3.5.3)をインストールすることです。確かに、システムウィンドウから環境変数を削除して、再度作成してください。

1
giuseppe trubia

システムにインストールされているApache Mavenバージョン.5.(mvn -vの結果)pom.xmlのmaven-compiler-plugin.8.のバージョンよりも低い

2
Yugerten

Eclipseでは、AntJava.home変数はWindowsJava_HOME環境変数に基づいていません。代わりに、プロジェクトのJREのホームディレクトリに設定されます。

デフォルトのJREを変更するには(たとえば、JDKに変更する)、[Windows]-> [設定...]に移動し、[Java]-> [インストール済みJRE]を選択します。-> [編集]-> C:\ Program Files\Java\jdk1 .8.0_172

0

私はIntellij Ideaを使用し、プロジェクトを再構築することで解決しました

ビルド->プロジェクトの再構築

0
prov