Bug 64465 - Gradle module metadata refers to invalid 'bom' artifact
Summary: Gradle module metadata refers to invalid 'bom' artifact
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.2.1
Hardware: Macintosh All
: P2 normal (vote)
Target Milestone: JMETER_5.4
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-21 15:44 UTC by Neil Farrington
Modified: 2021-01-21 14:58 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Farrington 2020-05-21 15:44:28 UTC
JMeter version 5.2.1 and beyond includes an invalid artifact 'org.apache.jmeter:bom' in the Gradle metadata file, which can cause Gradle to fail with the following error when a dependency on JMeter is present:

Could not find org.apache.jmeter:bom:5.2.1.

Gradle 6.0 publishes Gradle module metadata by default (https://blog.gradle.org/gradle-metadata-1.0). Since the JMeter project was upgraded to Gradle 6 (https://github.com/apache/jmeter/commit/6ef7d17fc345117dc61fcaa8603a3c71efd6fed3), Gradle module metadata has been published in addition to the Maven POM, which can be seen at https://repo1.maven.org/maven2/org/apache/jmeter/ApacheJMeter_core/5.2.1/

The Gradle metadata publishing should be fixed such that it doesn't include the invalid 'bom' artifact.
Comment 1 Vladimir Sitnikov 2020-05-21 16:53:18 UTC
Oh, I thought we did not publish Gradle metadata.
Comment 2 Daniel Platz 2020-07-16 14:22:57 UTC
Is there any update on this? Or possible workaround? I am not able to use this dependency from my gradle build. getting "Could not find org.apache.jmeter:bom:5.3" when depending on 
	compile 'org.apache.jmeter:ApacheJMeter_java:5.3'
Comment 3 David B. 2021-01-21 12:45:10 UTC
I apparently have the same problem with jmeter 5.4.

> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find org.apache.jmeter:bom:5.4.
     Searched in the following locations:
       - file:/C:/Users/user/.m2/repository/org/apache/jmeter/bom/5.4/bom-5.4.pom
       - https://repo.maven.apache.org/maven2/org/apache/jmeter/bom/5.4/bom-5.4.pom
     Required by:
         project : > org.apache.jmeter:ApacheJMeter_core:5.4
         project : > org.apache.jmeter:ApacheJMeter_components:5.4
         project : > org.apache.jmeter:ApacheJMeter_java:5.4
         project : > org.apache.jmeter:ApacheJMeter_jdbc:5.4
         project : > org.apache.jmeter:ApacheJMeter_http:5.4
         project : > org.apache.jmeter:ApacheJMeter_junit:5.4
         project : > org.apache.jmeter:ApacheJMeter_native:5.4
         project : > org.apache.jmeter:ApacheJMeter_core:5.4 > org.apache.jmeter:ApacheJMeter:5.4
         project : > org.apache.jmeter:ApacheJMeter_core:5.4 > org.apache.jmeter:jorphan:5.4

When will there be a solution here?
Comment 4 David B. 2021-01-21 14:58:50 UTC
(In reply to David B. from comment #3)
> I apparently have the same problem with jmeter 5.4.
> 
> > Could not resolve all files for configuration ':compileClasspath'.
>    > Could not find org.apache.jmeter:bom:5.4.
>      Searched in the following locations:
>        -
> file:/C:/Users/user/.m2/repository/org/apache/jmeter/bom/5.4/bom-5.4.pom
>        -
> https://repo.maven.apache.org/maven2/org/apache/jmeter/bom/5.4/bom-5.4.pom
>      Required by:
>          project : > org.apache.jmeter:ApacheJMeter_core:5.4
>          project : > org.apache.jmeter:ApacheJMeter_components:5.4
>          project : > org.apache.jmeter:ApacheJMeter_java:5.4
>          project : > org.apache.jmeter:ApacheJMeter_jdbc:5.4
>          project : > org.apache.jmeter:ApacheJMeter_http:5.4
>          project : > org.apache.jmeter:ApacheJMeter_junit:5.4
>          project : > org.apache.jmeter:ApacheJMeter_native:5.4
>          project : > org.apache.jmeter:ApacheJMeter_core:5.4 >
> org.apache.jmeter:ApacheJMeter:5.4
>          project : > org.apache.jmeter:ApacheJMeter_core:5.4 >
> org.apache.jmeter:jorphan:5.4
> 
> When will there be a solution here?

I found a workaround:
I added the following to build.gradle:
 def withoutBom = {
      exclude group: 'org.apache.jmeter', module: 'bom'
}

and in dependencies {
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: "${jmeterVersion}", withoutBom
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_components', version: "${jmeterVersion}", withoutBom
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_java', version: "${jmeterVersion}", withoutBom
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_jdbc', version: "${jmeterVersion}", withoutBom
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: "${jmeterVersion}", withoutBom
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_junit', version: "${jmeterVersion}", withoutBom
    compile group: 'org.apache.jmeter', name: 'ApacheJMeter_native', version: "${jmeterVersion}", withoutBom
    
}

So I was able to build my plugin using gradle and maven dependencies.