Maven清理安装问题:无法配置插件参数 [英] Maven clean install issue: Failed to configure plugin parameters

查看:189
本文介绍了Maven清理安装问题:无法配置插件参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Maven项目进行全新安装,但我发现了一个问题。控制台显示以下错误:

I'm trying to made a clean install for a Maven project but I found a problem. The console displays this error:

[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-enforcer-plugin:1.0

Cause: Class 'org.apache.maven.enforcer.rule.api.EnforcerRule' cannot be instantiated

命令行的错误相同:

mvn release:prepare -Dresume=false

这是所有项目的pom:

This is the pom of all the project:

<?xml version="1.0" encoding="UTF-8"?>
<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>
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>org.aperteworkflow</groupId>
    <artifactId>aperteworkflow-core</artifactId>
    <version>2.1</version>
    <packaging>pom</packaging>

    <name>Aperte Workflow</name>
    <description>Aperte Workflow is a compilation of well-known, stable and mature frameworks into a
        complete BPM solution developed by BlueSoft sp. z o.o. - Polish independent software vendor.
        Project home page is available at http://www.aperteworkflow.org/</description>

    <modules>
        <module>core</module>
        <module>plugins</module>
        <module>utils</module>
        <module>samples</module>
        <module>vaadin-addons</module>
    </modules>

    <licenses>
        <license>
            <name>GNU Lesser General Public License, Version 2.1</name>
            <url>http://www.gnu.org/licenses/lgpl-2.1.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:https://github.com/bluesoft-rnd/aperte-workflow-core.git</connection>
        <developerConnection>scm:git:https://github.com/bluesoft-rnd/aperte-workflow-core.git</developerConnection>
        <url>https://github.com/bluesoft-rnd/aperte-workflow-core.git</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.compiler.source>1.6</project.build.compiler.source>
        <project.build.compiler.target>1.6</project.build.compiler.target>
        <jbpm.version>4.4</jbpm.version>
        <spring.version>3.0.5.RELEASE</spring.version>
        <vaadin.version>6.8.3</vaadin.version>
        <hibernate.version>3.6.10.Final</hibernate.version>
        <postgres.version>8.4-702.jdbc4</postgres.version>
        <junit.version>4.8.2</junit.version>
        <liferay.version>6.1.1</liferay.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>pl.net.bluesoft</groupId>
            <artifactId>util</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgres.version}</version>
            <scope>test</scope>
        </dependency>   
        <dependency>
            <groupId>net.htmlparser.jericho</groupId>
            <artifactId>jericho-html</artifactId>
            <version>3.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>jar</goal>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${project.build.compiler.source}</source>
                        <target>${project.build.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <pushChanges>false</pushChanges>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>

这是插件测试子项目的pom:

and this is the pom of plugin test subproject:

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
        <artifactId>plugins</artifactId>
        <groupId>org.aperteworkflow</groupId>
        <version>2.0</version>
    </parent>
   <groupId>org.aperteworkflow</groupId>
   <artifactId>plugins-test</artifactId>
   <packaging>jar</packaging>
   <version>2.0</version>
   <name>A sample test case for Infinispan</name>
   <url>http://www.myorganization.org</url>


   <properties>
      <!--
         Which Infinispan version do you want to use?  Released versions are always more reliable than snapshots!
      -->
      <version.infinispan>5.1.3.FINAL</version.infinispan>


      <!-- the default JGroups protocol stack to use -->
      <infinispan.test.jgroups.protocol>tcp</infinispan.test.jgroups.protocol>
      <!-- the default transaction manager to use -->
      <infinispan.test.jta.tm>dummytm</infinispan.test.jta.tm>

      <!-- Versions of dependencies -->
      <version.commons.logging>1.1</version.commons.logging>
      <version.easymock>2.4</version.easymock>
      <version.easymockclassext>2.4</version.easymockclassext>
      <version.jbossjta>4.16.2.Final</version.jbossjta>
      <version.log4j>1.2.16</version.log4j>
      <version.testng>5.11</version.testng>
      <version.xstream>1.4.1</version.xstream>
   </properties>

   <dependencies>
           <dependency>
            <groupId>org.aperteworkflow</groupId>
            <artifactId>jbpm-context</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.aperteworkflow</groupId>
            <artifactId>integration-interface</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.3</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.aperteworkflow</groupId>
            <artifactId>integration</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.aperteworkflow</groupId>
            <artifactId>bpm-notifications</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>javax.transaction</groupId>
                    <artifactId>jta</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>catalina</artifactId>
            <version>6.0.18</version>
        </dependency>
   </dependencies>

   <build>
      <plugins>
         <!-- enforce java 1.6 and maven 2.1.0 -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.0-beta-1</version>
            <executions>
               <execution>
                  <id>enforce-java</id>
                  <goals>
                     <goal>enforce</goal>
                  </goals>
                  <configuration>
                     <rules>
                        <requireJavaVersion>
                           <version>[1.6,)</version>
                        </requireJavaVersion>
                        <requireMavenVersion>
                           <version>[2.1.0,)</version>
                        </requireMavenVersion>
                     </rules>
                  </configuration>
               </execution>
            </executions>
         </plugin>

         <!-- by default, compile to JDK 1.6 compatibility -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
               <source>1.6</source>
               <target>1.6</target>
               <encoding>UTF-8</encoding>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>

我不知道出了什么问题。有人可以帮帮我吗?

I don't know what's wrong. Can someone help me please?

推荐答案

查看POM。有人在那里配置了 maven-enforcer-plugin 。尝试运行哪个命令无关紧要,Maven将始终失败,因为 maven-enforcer-plugin 首先运行 - 它的工作是确保环境是什么构建需求。

Look into the POM. Someone configured the maven-enforcer-plugin in there. It doesn't matter which command you try to run, Maven will always fail because the maven-enforcer-plugin runs first - it's job is to make sure the environment is what the build needs.

查看 pom.xml 并搜索 maven-enforcer-插件。当您使用您的Maven版本不支持的插件版本时,可能会发生上述错误。如有疑问,请尝试最新版本( 1.3.1 )。

Look into the pom.xml and search for maven-enforcer-plugin. The error above can happen when you use a version of the plugin which isn't supported by your version of Maven. If in doubt, try the latest version (1.3.1).

它也可能意味着本地副本该插件已损坏。搜索 $ HOME / .m2 / repository 获取 maven-enforcer-plugin * .jar 并删除整个文件夹。

It can also mean that the local copy of the plugin is corrupt. Search $HOME/.m2/repository for maven-enforcer-plugin*.jar and delete the whole folder.

这篇关于Maven清理安装问题:无法配置插件参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆