繁体   English   中英

如何阻止 maven-assembly-plugin 在 windows 上的 eclipse 中使用旧版本

[英]How to stop the maven-assembly-plugin from using an old version in eclipse on windows

我在 windows 10 环境中使用 eclipse 版本:2020-06 (4.16.0) 构建 ID:20200615-1200。 当我尝试run maven clean compile assembly:single命令时,构建使用的是非常旧版本的程序集插件。 尽管我在我的 pom 文件中提供了 maven-assembly-plugin 的 3.2.0 版本,但构建使用的是旧版本(2.2-beta-5)。 我怎样才能解决这个问题? 这是我的pom文件:

  <modelVersion>4.0.0</modelVersion>
  <groupId>auditlog</groupId>
  <artifactId>auditlog</artifactId>
  <version>1.0</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
   <repositories>
    <repository>
       <id>my-local-repo</id>
       <url>file://${basedir}/lib</url>
    </repository>
   </repositories>   
<profiles>
    <profile>
     <!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. -->
     <!-- Use this profile for any OpenShift specific customization your app will need. -->
     <!-- By default that is to put the resulting archive into the 'deployments' folder. -->
     <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
     <id>openshift</id>
     <build>
        <finalName>AuditlogApp</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <mainClass>com.ibm.amg.services.auditlog.AuditLogService</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-dependency-plugin</artifactId>
              <executions>
                <execution>
                  <id>copy-dependencies</id>
                  <phase>prepare-package</phase>
                  <goals>
                    <goal>copy-dependencies</goal>
                  </goals>
                  <configuration>
                    <outputDirectory>${project.build.directory}/${project.build.finalName}.lib</outputDirectory>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jar-plugin</artifactId>
              <configuration>
                <archive>
                  <manifest>
                    <addClasspath>true</addClasspath>
                    <classpathPrefix>${project.build.finalName}.lib/</classpathPrefix>
                    <mainClass>${fully.qualified.main.class}</mainClass>
                  </manifest>
                </archive>
              </configuration>
            </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
 <dependencies>
     <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>3.12.6</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/io.grpc/grpc-all -->
    <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-all</artifactId>
        <version>1.30.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito -->
    <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-mockito</artifactId>
        <version>1.7.4</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.powermock/powermock-module-junit4 -->
    <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>2.0.7</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>proto</groupId>
        <artifactId>proto</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>amglib</groupId>
        <artifactId>amglib</artifactId>
        <version>1.0</version>
    </dependency>
 </dependencies> 
</project>```
How can I fix this.  

看maven 3.兼容性矩阵:

https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Plugin+Compatibility+Matrix

报告的版本是 2.2-beta-5。 为什么需要 3.2.0 版本?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM