我尝试使用github中的谷歌语音客户端使用语音文字:
https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/speech/cloud-client
在pom.xml中显示以下问题:
描述资源路径位置类型
生命周期配置未涵盖插件执行:org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile(执行:default-testCompile,阶段:test-compile)pom.xml / speech-google-cloud-samples line 23 Maven项目构建生命周期映射问题
我该如何解决这个问题?对不起长代码..
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.speech</groupId>
<artifactId>speech-google-cloud-samples</artifactId>
<packaging>jar</packaging>
<!-- Parent defines config for testing & linting. -->
<parent>
<artifactId>doc-samples</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.0.0</version>
<relativePath>../..</relativePath>
</parent>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- FIXME(lesv) - temp to fix an issue w/ GA Datastore -->
<!--
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</dependencyManagement>
-->
<dependencies>
<!-- [START dependencies] -->
<!-- https://mvnrepository.com/artifact/com.google.cloud/google-cloud-speech -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-speech</artifactId>
<version>0.17.2-alpha</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.1.0</version>
<exclusions>
<exclusion> <!-- exclude an old version of Guava -->
<groupId>com.google.guava</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.8.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.grpc/grpc-core -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.8.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java-util -->
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>0.17.0</version>
<exclusions>
<exclusion> <!-- exclude an old version of Guava -->
<groupId>com.google.guava</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- [END dependencies] -->
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>0.32</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.example.language.QuickstartSample</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>
`
答案 0 :(得分:0)
您的标题和帖子内容显示了两个不同的问题。我将回复你帖子内容所描述的内容。
你的问题是一个典型的日食整合问题;也就是说,你需要指示eclipse如何处理你的pom引用的各种插件(你可能想忽略它们)。
因此,在您的情况下,您需要将以下代码复制/粘贴到您的pom中;这只会在Eclipse中生效,否则会被忽略。请注意,对于其他插件,您可能会遇到相同的错误,因此您需要重复/调整该过程以解决您可能遇到的任何类似错误。
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<versionRange>[0.0.0,)</versionRange>
<goals>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>