Error in Gradle Build

I’ve been building a plugin using Gradle, and in the past it has worked successfully. This is the instructions I’ve followed below:

katalon-studio-platform/create-plugin-using-gradle.md at master · katalon-studio/katalon-studio-platform (github.com)

In the past this has been able to successfully build, but lately I’ve been getting an error:

Could not find any version that matches javax.annotation:javax.annotation-api:[1.3.5,2.0.0).
Versions that do not match:
** - 1.3.2**
** - 1.3.1**
** - 1.3**
** - 1.2**
** - 1.2-b04**
** - + 3 more**
Required by:
** project : > com.katalon:com.katalon.platform:1.0.6 > org.eclipse.platform:org.eclipse.e4.core.contexts:1.5.1 > org.eclipse.platform:org.eclipse.e4.core.di:1.7.700**

Possible solution:
** - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html**

It seems that some version of something has been updated, but I’m not sure what it was. Any way to get this to successfully compile would be helpful.

I confirmed that katalon-studio-platform/create-plugin-using-gradle.md at master · katalon-studio/katalon-studio-platform (github.com) does not build at all. I saw the following message in console.

$ gradle build

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find any version that matches javax.annotation:javax.annotation-api:[1.3.5,2.0.0).
     Versions that do not match:
       - 1.3.2
       - 1.3.1
       - 1.3
       - 1.2
       - 1.2-b04
       - + 3 more
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/javax/annotation/javax.annotation-api/maven-metadata.xml
       - https://jcenter.bintray.com/javax/annotation/javax.annotation-api/maven-metadata.xml
     Required by:
         project : > com.katalon:com.katalon.platform:1.0.6 > org.eclipse.platform:org.eclipse.e4.core.contexts:1.5.1 > org.eclipse.platform:org.eclipse.e4.core.di:1.7.700

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

I checked the dependency of org.eclipse.platform:org.eclipse.e4.core.di:1.7.700 at https://repo1.maven.org/maven2/org/eclipse/platform/org.eclipse.e4.core.di/1.7.700/org.eclipse.e4.core.di-1.7.700.pom where I found the following fragment:

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>[1.3.5,2.0.0)</version>
</dependency>

Yes, org.eclipse.platform:org.eclipse.e4.core.di:1.7.700 declares its dependency on javax.annotation:javax.annotation-api version [1.3.5, 2.0.0). This means com.katalon:com.katalon.platform:1.0.6 transitively depends on javax.annotation:javax.annotation-api version [1.3.5, 2.0.0).

But I could not find the javax.annotation:javax.annotation-api version [1.3.5, 2.0.0) anywhere on the Internet. I suppose that javax.annotation:javax.annotation-api version [1.3.5, 2.0.0) does not exists in the world at all now.

According to the Maven Central page, the org.eclipse.e4.core.di/1.7.700 was released in March 2021 just recently.

I checked the pom of the previous version “org.eclipse.platform:org.eclipse.e4.core.di:1.7.600” here which as release Junn 2020. I found, 1.7.600 does NOT depend on the javax.annotaiton API!

So I believe that the org.eclipse.platform:org.eclipse.e4.core.di:1.7.700 is problematic. Careless mistake?

I wanted to download the source code of org.eclipse.platform:org.eclipse.e4.core.di project and try building it on my machine. But I could not find it. I can do no more.

I checked the dependency of com.katalon.platform:1.0.6 at https://github.com/katalon-studio/katalon-studio-platform/blob/master/pom.xml. There found a line:

 <org.eclipse.e4.ui.di.version>1.1.100</org.eclipse.e4.ui.di.version>

It seems that Katalon programmers intended to fix the version of org.eclipse.e4.ui.di.version to 1.1.100. This intension is in Maven way (= nearest first strategy).

But, despite their intension, acutually org.eclipse.e4.ui.di.version:1.7.700 was refered to, and it caused katalon-studio-platform/create-plugin-using-gradle.md at master · katalon-studio/katalon-studio-platform (github.com) unable to build at all.

Here is a version conflict caused by transitive dependency.

@ThanhTo
@duyluong

I hope Katalon team to resolve this dependency version conflict in Gradle.

As documented here, Gradle takes a strategy for resolving dependency conflict different from Maven:

Gradle will consider all requested versions, wherever they appear in the dependency graph. Out of these versions, it will select the highest one.

Then how to solve? — well I do not know yet.

I wonder if the Eclipse e4 incubating project is stable enough or not. If not, being dependent on it is risky isn’t it?

Or someone in Katalon Team to raise a bug report for the org.eclipse.e4.ui.di.version:1.7.700 and to ask Eclipse team to fix it.

edit:
javax.annotation-api was succeeded by jakarta.annotation-api which has released version [1.3.5,2.0.0)
See this post

Possiblly the developer of org.eclipse.e4.core.di:1.7.700 made a mistake; he intended to select the jakarta.annotation-api [1.3.5, 2.0.0) but mistakenly wrote javax.jannotation-api [1.3.5, 2.0.0) which does not exist.

1 Like

@kazurayam

We will take a look into this issue. There was a similar report but for the maven build: Can't package my-first-katalon-plugin

@duyluong has there been any progress on this issue? What is its status?

Edit: I saw your reply on the other thread… Looks like this has been remedied. :confetti_ball:

Please use com.katalon.platform.parent and com.katalon.platform version 1.0.17