2

从 thorntail 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 报告

堆栈跟踪很长,但这是 2 次测试失败的原因:

  1. 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
    
  2. 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
    
4

0 回答 0