Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue debugging with the plugin #888

Open
MohSakhaei opened this issue May 24, 2024 · 19 comments
Open

Issue debugging with the plugin #888

MohSakhaei opened this issue May 24, 2024 · 19 comments

Comments

@MohSakhaei
Copy link

MohSakhaei commented May 24, 2024

Hello,

I’m encountering an issue when running the libertyDev task in my Gradle project. The task fails with the following error message:

Could not find artifact with coordinates io.openliberty:openliberty-kernel:[23.0.0.3,). Verify a Maven repository is configured that contains the corresponding artifact.

However, I have confirmed that the openliberty-kernel artifact is present in my Nexus repository. I’ve also cleared my Gradle cache, but the issue persists.

Here are some details about my setup:

Gradle version: 8.5 (local distribution)
liberty-gradle-plugin version: 3.8.3
Nexus repository: local
I’m not specifying a version range for openliberty-kernel in my build.gradle file, so I suspect that the version range might be specified internally by the liberty-gradle-plugin.

I’ve tried several troubleshooting steps, including forcing a specific version of the dependency and refreshing all Gradle projects in my IDE, but none have resolved the issue.

Could you please help me understand why this is happening and how I can fix it? Let me know if you need any more information.

Thank you for your assistance.

Caused by: org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution 'file:///C:/Gradle/gradle-8.5-bin.zip'.
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:43)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:69)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)

Caused by: org.gradle.internal.exceptions.DefaultMultiCauseException: Could not resolve io.openliberty:openliberty-kernel:[23.0.0.3,).
Required by:
project :Component_Properties
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Failed to list versions for io.openliberty:openliberty-kernel.
Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from http://wsp4983c:8081/repository/maven-central/io/openliberty/openliberty-kernel/maven-metadata.xml.

@cherylking
Copy link
Member

Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from http://wsp4983c:8081/repository/maven-central/io/openliberty/openliberty-kernel/maven-metadata.xml.

That is the root of the problem. Is that file accessible and do the contents look similar to what is listed here?

@MohSakhaei
Copy link
Author

MohSakhaei commented May 24, 2024

They look identical to me; this is what I get when I inspect it in the browser: <metadata> <groupId>io.openliberty</groupId> <artifactId>openliberty-kernel</artifactId> <versioning> <latest>24.0.0.5</latest> <release>24.0.0.5</release> <versions> <version>18.0.0.2</version> <version>18.0.0.3</version> <version>18.0.0.4</version> <version>19.0.0.1</version> <version>19.0.0.2</version> <version>19.0.0.3</version> <version>19.0.0.4</version> <version>19.0.0.5</version> <version>19.0.0.6</version> <version>19.0.0.7</version> <version>19.0.0.8</version> <version>19.0.0.9</version> <version>19.0.0.10</version> <version>19.0.0.11</version> <version>19.0.0.12</version> <version>20.0.0.1</version> <version>20.0.0.2</version> <version>20.0.0.3</version> <version>20.0.0.4</version> <version>20.0.0.5</version> <version>20.0.0.6</version> <version>20.0.0.7</version> <version>20.0.0.8</version> <version>20.0.0.9</version> <version>20.0.0.10</version> <version>20.0.0.11</version> <version>20.0.0.12</version> <version>21.0.0.1</version> <version>21.0.0.2</version> <version>21.0.0.3</version> <version>21.0.0.4</version> <version>21.0.0.5</version> <version>21.0.0.6</version> <version>21.0.0.7</version> <version>21.0.0.8</version> <version>21.0.0.9</version> <version>21.0.0.10</version> <version>21.0.0.11</version> <version>21.0.0.12</version> <version>22.0.0.1</version> <version>22.0.0.2</version> <version>22.0.0.3</version> <version>22.0.0.4</version> <version>22.0.0.5</version> <version>22.0.0.6</version> <version>22.0.0.7</version> <version>22.0.0.8</version> <version>22.0.0.9</version> <version>22.0.0.10</version> <version>22.0.0.11</version> <version>22.0.0.12</version> <version>22.0.0.13</version> <version>23.0.0.1</version> <version>23.0.0.2</version> <version>23.0.0.3</version> <version>23.0.0.4</version> <version>23.0.0.5</version> <version>23.0.0.6</version> <version>23.0.0.7</version> <version>23.0.0.8</version> <version>23.0.0.9</version> <version>23.0.0.10</version> <version>23.0.0.11</version> <version>23.0.0.12</version> <version>24.0.0.1</version> <version>24.0.0.2</version> <version>24.0.0.3</version> <version>24.0.0.4</version> <version>24.0.0.5</version> </versions> <lastUpdated>20240521051157</lastUpdated> </versioning> </metadata>

@cherylking
Copy link
Member

That looks correct, so I am not sure why you are getting the exception saying it cannot be loaded.

@MohSakhaei
Copy link
Author

Yeah, I am basically crying at the moment :)) I have been dealing with this issue for days. It looks horrible on me.

@cherylking
Copy link
Member

Has this worked previously on this machine with other Gradle projects? Or is this a new set up?

@MohSakhaei
Copy link
Author

MohSakhaei commented May 24, 2024

We were trying to migrate a project from Payara to Open Liberty, its Gradle version was old as well, so we upgraded to 8.5. gradle clean war works perfectly fine, but gradle libertyDev fails like this.

@cherylking
Copy link
Member

What Java version are you using? I'm going to test locally with Gradle 8.5. The latest we tested with is 8.4 so far.

@MohSakhaei
Copy link
Author

java version "1.8.0_411"
Java(TM) SE Runtime Environment (build 1.8.0_411-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.411-b25, mixed mode)

@MohSakhaei
Copy link
Author

I can debug with attaching to the server with no problems, but it is not the same as debugging from IntelliJ at all. The project is based on JavaEE8.

@cherylking
Copy link
Member

Are you also using Liberty Tools for IntelliJ? You didn't mention it in this issue, so I am wondering.

@MohSakhaei
Copy link
Author

MohSakhaei commented May 24, 2024

Yes, I am using it.
dependencies { classpath("net.serenity-bdd:serenity-gradle-plugin:2.3.12") classpath("io.openliberty.tools:liberty-gradle-plugin:3.8.3") }
`allprojects {
tasks.withType(JavaCompile) {
options.encoding = "windows-1252"
}
tasks.withType(Test) {
systemProperty "file.encoding", "windows-1252"
}

apply plugin: 'maven-publish'
apply plugin: 'java-library'
apply plugin: 'war'
apply plugin: 'net.serenity-bdd.aggregator'
apply plugin: 'eclipse-wtp'
apply plugin: 'liberty'
apply plugin: 'idea'`

@cherylking
Copy link
Member

Sorry, I should have been more specific. I wasn't talking about Liberty Gradle Plugin. We have an integrated IDE extension called Liberty Tools for IntelliJ. See the marketplace here. Just for your information if you want to try it. It won't solve this issue though.

@MohSakhaei
Copy link
Author

Yes, I meant this https://plugins.jetbrains.com/plugin/14856-liberty-tools I had to downgrade my IntelliJ since it wasn't compatible with 2024 versions.

@MohSakhaei
Copy link
Author

when I fire it up, it calls this shell command: cmd /K "C:\Gradle\bin\gradle.bat" libertyDev --stacktrace --libertyDebugPort=62855

@cherylking
Copy link
Member

Ok, so you are running libertyDev through the IDE then? Not from the command line?

@MohSakhaei
Copy link
Author

I am doing both with same result really

@MohSakhaei
Copy link
Author

MohSakhaei commented May 24, 2024

I've created the gradle-wrapper.properties file since Gradle was trying to download itself and was choking on it. This behavior only happened with this plugin, when I was running gradle clean war it didn't try to download itself: #Thu May 23 14:02:41 GMT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=file:///C:/Gradle/gradle-8.5-bin.zip

@cherylking
Copy link
Member

Alright, so I am not able to recreate locally. I just tried Gradle 8.5 with Java 8 and was able to run libertyDev successfully whether or not a specific version of Liberty was specified in the build.gradle. It has to be something with not being able to access that file in the Nexus repository. The only thing I know to suggest is to run with trace enabled -i -s and maybe the debug flag -d to get more info about this error message:

Caused by: org.gradle.api.resources.ResourceException: Unable to load Maven meta-data from http://wsp4983c:8081/repository/maven-central/io/openliberty/openliberty-kernel/maven-metadata.xml.

@MohSakhaei
Copy link
Author

MohSakhaei commented May 24, 2024

output.zip
I am going to attach a compressed log file, when it is finished, it's going to be huge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants