类库解析endpoints-framework中的错误:discoveryDocs

时间:2017-06-15 13:49:26

标签: google-cloud-endpoints-v2

我正在尝试将项目从端点v1迁移到端点v2,但无法创建发现文档。运行

$ mvn -DskipTests -X endpoints-framework:discoveryDocs

导致构建失败

[ERROR] Failed to execute goal com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0:discoveryDocs (default-cli) on project myproject: Execution default-cli of goal com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0:discoveryDocs failed: A required class was missing while executing com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0:discoveryDocs: org/apache/commons/dbutils/ResultSetHandler
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.google.cloud.tools:endpoints-framework-maven-plugin:1.0.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/me/.m2/repository/com/google/cloud/tools/endpoints-framework-maven-plugin/1.0.0/endpoints-framework-maven-plugin-1.0.0.jar
[ERROR] urls[1] = file:/Users/me/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
...

我可以看到相应的.jar文件位于-cp参数中:

..., /Users/me/.m2/repository/commons-dbutils/commons-dbutils/1.6/commons-dbutils-1.6.jar, ...

但不在错误网址(urls[0..48] = ...

构建和测试运行正确(mvn verify等),因此库实际上存在并且有效,但我认为没有发现文档它实际上无法运行。

我可能错过任何想法?该类路径中似乎有大量的.jar文件,有一些限制吗?

1 个答案:

答案 0 :(得分:1)

您必须将endpoints-framework-maven-plugin更新为版本1.0.1:

<plugin>
    <groupId>com.google.cloud.tools</groupId>
    <artifactId>endpoints-framework-maven-plugin</artifactId>
    <version>1.0.1</version>
    <configuration>
        <!-- plugin configuration -->
        <hostname>YOUR-APPP-ID.appspot.com</hostname>
    </configuration>
</plugin>

版本1.0.0中存在错误,请参见此处: https://github.com/GoogleCloudPlatform/endpoints-framework-maven-plugin/issues/32