简体   繁体   English

Maven 依赖管理正在导入错误的版本

[英]Maven Dependency Management is importing wrong version

I am cloning project to import a 7.13 version dependency as depicted here.我正在克隆项目以导入 7.13 版本依赖项,如此处所述。 As you can see, the camunda-webapp: 7.11.0 (managed from 7.13.0) is creeping in. This is causing some ClassNotFoundExceptions since I need camunda-webapp: 7.13.0 which IS happening correctly in a diff project I dont own.如您所见, camunda-webapp: 7.11.0 (从 7.13.0 管理)正在悄悄进入。这导致了一些 ClassNotFoundExceptions,因为我需要camunda-webapp: 7.13.0 ,它在我不拥有的 diff 项目中正确发生. I did a lot of digging and exclusions but I'm not able to figure out where is this whole 7.11.0 (managed from 7.13.0) is even coming from.我做了很多挖掘和排除,但我什至无法弄清楚整个7.11.0 (managed from 7.13.0)

How can i force this project to use 7.13.0 throughout?我如何强制该项目始终使用7.13.0

在此处输入图像描述

However, In another project importing 7.13 imports the transitive 7.13 correctly.但是,在另一个项目中导入 7.13 会正确导入可传递的 7.13。

在此处输入图像描述

EDIT - Updating the POM here to triage the fix:编辑 - 在此处更新 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>org.camunda.bpm.getstarted</groupId>
  <artifactId>camunda-ctil-cockpit</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <properties>
    <camunda.spring-boot.version>7.13.0</camunda.spring-boot.version>
    <spring-boot.version>2.3.9.RELEASE</spring-boot.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <capitalone.camunda.plugin.version>1.5</capitalone.camunda.plugin.version>
  </properties>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.capitalone.camunda.plugins</groupId>
        <artifactId>plugin-dependencies</artifactId>
        <version>${capitalone.camunda.plugin.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>

  </dependencyManagement>
  
  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
      <version>${camunda.spring-boot.version}</version>
      <exclusions>
        <exclusion>
            <groupId>org.camunda.bpm.webapp</groupId>
            <artifactId>camunda-webapp-webjar</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
      <version>${camunda.spring-boot.version}</version>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.2.3</version>
    </dependency>
    <dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>capitalone-uioverlay</artifactId>
      <exclusions>
        <exclusion>
            <groupId>org.camunda.bpm.webapp</groupId>
            <artifactId>camunda-webapp</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>spring-plugin-commons</artifactId>
    </dependency>
    <dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>custom-engine-types</artifactId>
      <exclusions>
        <exclusion>
            <groupId>org.camunda.bpm.webapp</groupId>
            <artifactId>camunda-webapp</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>common-cockpit-extensions</artifactId>
      <exclusions>
        <exclusion>
            <groupId>org.camunda.bpm.webapp</groupId>
            <artifactId>camunda-webapp</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm.identity</groupId>
      <artifactId>camunda-identity-ldap</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-oauth2</artifactId>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.2</version>
    </dependency>

    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
    </dependency>

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>
  </dependencies>
  
   <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${spring-boot.version}</version>
        <configuration>
          <layout>ZIP</layout>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
     <finalName>camunda-ctil-cockpit</finalName>
  </build>
  
</project>

However this results still in. As you can see 7.11 is still there.然而,这个结果仍然存在。如您所见,7.11 仍然存在。 If I exclude 7.11 completely, the camunda-webapp.jar completely disappears.如果我完全排除 7.11, camunda-webapp.jar完全消失。 Was hoping 7.13 would get popped in. Also camunda-webapp-webjar is completely removed, comparing to the screenshots above:希望 7.13 会出现。与上面的屏幕截图相比, camunda-webapp-webjar也被完全删除: 在此处输入图像描述

First change the property value of首先更改属性值

<camunda.spring-boot.version>3.2.0</camunda.spring-boot.version>

to 7.13.0 See eg https://start.camunda.com/7.13.0参见例如https://start.camunda.com/

If the issue persists the the plugin jars define their own versions, not driven by the BOM:如果问题仍然存在插件 jars 定义自己的版本,而不是由 BOM 驱动:

You shared the main project POM including the engine and webapps, but the unwanted dependency is coming in as a dependency of your custom com.capitalone.* jars, as the screenshot of the dependency tree shows.您共享了主项目 POM,包括引擎和 Web 应用程序,但是不需要的依赖项作为自定义 com.capitalone.* jars 的依赖项进入,如依赖项树的屏幕截图所示。 camunda-webapp:7.11.0 is a dependency which is pulled in by camunda-webapp:7.11.0 是一个依赖项,由

1)
<dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>capitalone-uioverlay</artifactId>
    </dependency>
2)  
    <dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>custom-engine-types</artifactId>
    </dependency>
3)
    <dependency>
      <groupId>com.capitalone.camunda.plugins</groupId>
      <artifactId>common-cockpit-extensions</artifactId>
    </dependency>

A) If possible update the POMs of those projects and run a mvn clean install on them A) 如果可能更新这些项目的 POM 并在它们上运行 mvn clean install

B) If you have no control over these projects then you can also add exclusions to the dependency tags listed above (as the jar is already included in the main project). B) 如果您无法控制这些项目,那么您还可以将排除项添加到上面列出的依赖项标记中(因为 jar 已包含在主项目中)。 However, this would mean your plugin jars running with another jar version than they have been compiled against.但是,这意味着您的插件 jars 与另一个 jar 版本一起运行,而不是针对它们进行编译。 It is not a good practice and may cause issue if compatibility changed.这不是一个好的做法,如果兼容性发生变化,可能会导致问题。

On a different note: "Please note that we updated the frontend plugin interface with Camunda Platform Runtime 7.14. Plugins written for Camunda Platform Runtime 7.13 and earlier might no longer work with Camunda Platform Runtime 7.14. Checkout the update guide for more details."在不同的注释中:“请注意,我们使用 Camunda Platform Runtime 7.14 更新了前端插件界面。为 Camunda Platform Runtime 7.13 及更早版本编写的插件可能不再适用于 Camunda Platform Runtime 7.14。查看更新指南了解更多详细信息。” https://docs.camunda.org/manual/latest/webapps/cockpit/extend/plugins/ https://docs.camunda.org/manual/latest/webapps/cockpit/extend/plugins/

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

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