Из сайта git-hub с колючим хвостом:
https://github.com/thorntail/thorntail-examples/blob/master/gradle-examples/jaxrs-cdi/
Я попытался построить пример проекта. Тем не менее, я получаю эту ошибку:
$ gradle build
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':thorntail-package'.
> Could not find bom-all.jar (io.thorntail:bom-all:2.3.0.Final).
Searched in the following locations:
file:/home/wsi/.m2/repository/io/thorntail/bom-all/2.3.0.Final/bom-all-2.3.0.Final.jar
* 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 6s
6 actionable tasks: 6 executed
Моя система - Ubuntu 18.04:
$ gradle --version
------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------
Build time: 2018-11-26 11:48:43 UTC
Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987
Kotlin DSL: 1.0.4
Kotlin: 1.3.10
Groovy: 2.5.4
Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM: 10.0.2 (Oracle Corporation 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OS: Linux 4.15.0-43-generic amd64
Примечание с использованием VERSION_THORNTAIL = 2.3.0.Final или 2.2.1.Final дает те же результаты
Буду признателен за любую помощь, я бы хотел использовать gradle для создания своего проекта, но если я не смогу заставить это работать, мне придется вернуться к maven. Я предполагаю, что есть ошибка в их файле build.gradle или в плагине thorntail и в способе настройки зависимостей. Я думаю, что если никто не знает ответ, мне придется составить для этого вопрос JIRA.
РЕДАКТИРОВАТЬ: я добавляю больше информации в ответ на комментарии ниже:
Сначала с Java 10:
12:45 wsi@ubuntu ~/dev/workspace-thorntail-examples/gradle-examples/jaxrs-cdi [master]: Up-to-date
$ java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
12:45 wsi@ubuntu ~/dev/workspace-thorntail-examples/gradle-examples/jaxrs-cdi [master]: Up-to-date
$ ./gradlew clean build -DthorntailVersion=2.2.1.Final
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'example-gradle'.
> Could not resolve all dependencies for configuration ':classpath'.
> Multiple build operations failed.
Could not initialize class org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomReader
Could not initialize class org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomReader
Could not initialize class org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomReader
Could not initialize class org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomReader
* 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
В Java 8 он собирается, но тесты не пройдены
$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
12:47 wsi@ubuntu ~/dev/workspace-thorntail-examples/gradle-examples/jaxrs-cdi [master]: Up-to-date
$ ./gradlew clean build -DthorntailVersion=2.2.1.Final
> Task :test
org.wildfly.swarm.examples.gradle.ArqWarDeploymentTest > classMethod FAILED
org.jboss.arquillian.container.spi.client.container.DeploymentException
Caused by: org.jboss.shrinkwrap.resolver.api.NoResolvedResultException
Caused by: org.eclipse.aether.resolution.DependencyResolutionException
Caused by: org.eclipse.aether.collection.DependencyCollectionException
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException
Caused by: org.eclipse.aether.transfer.ArtifactTransferException
Caused by: org.apache.maven.wagon.authorization.AuthorizationException
org.wildfly.swarm.examples.gradle.ArqContainerTest > classMethod FAILED
org.jboss.arquillian.container.spi.client.container.DeploymentException
Caused by: org.jboss.shrinkwrap.resolver.api.NoResolvedResultException
Caused by: org.eclipse.aether.resolution.DependencyResolutionException
Caused by: org.eclipse.aether.collection.DependencyCollectionException
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException
Caused by: org.eclipse.aether.transfer.ArtifactTransferException
Caused by: org.apache.maven.wagon.authorization.AuthorizationException
2 tests completed, 2 failed
> Task :test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///home/wsi/dev/workspace-thorntail-examples/gradle-examples/jaxrs-cdi/build/reports/tests/test/index.html
* 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 2m 51s
9 actionable tasks: 9 executed
Редактировать 2: Добавление более подробной информации из
Файл: ///home/wsi/dev/workspace-thorntail-examples/gradle-examples/jaxrs-cdi/build/reports/tests/test/index.html
отчет
Трассировка стека довольно длинная, но вот причина двух неудачных тестов:
org.wildfly.swarm.examples.gradle> ArqContainerTest
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://maven-server:8081/nexus/content/groups/releases/com/fasterxml/classmate/1.3.3/classmate-1.3.3.pom
org.wildfly.swarm.examples.gradle> ArqWarDeploymentTest
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://maven-server:8081/nexus/content/groups/releases/io/thorntail/msc/2.2.1.Final/msc-2.2.1.Final.pom