执行goal com.spotify:docker-maven-plugin:1.0.0:build Exception caught: basedir src/main/docker不存在
使用docker部署Spring Cloud项目,一些代码在pomc .xml中:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- tag::plugin[] -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
<!-- end::plugin[] -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
[INFO] [INFO] – spring-boot-maven-plugin:1.5.2。发布:repackage
(default) @ eureka-server- [INFO] [INFO] –
docker-maven-plugin:1.0.0:build (default-cli) @ eureka-server-
[ConfigFileRegistryAuthSupplier] [INFO]复制
/Users/eureka-server/target/eureka-server-0.0.1- snapshot .jar ->
/用户/ eureka-server /目标/码头工人/ eureka-server-0.0.1-SNAPSHOT.jar
[信息]——[信息]构建失败[信息]
-[信息]总时间:6.728秒[信息]了:
2017 – 11 – 15 – t20:51:07 +喂饲[信息]最后的记忆:41米/ 361 m[信息]
–
(错误)未能执行目标com.spotify: docker-maven-plugin: 1.0.0:构建(default-cli)项目
eureka-server:异常捕获:basedir src/main/docker不
存在->要查看
错误的完整堆栈跟踪,请使用-e开关重新运行Maven。[错误]使用
的-X开关重新运行Maven以启用完整的调试日志记录。[ERROR] [ERROR]更多
关于错误和可能的解决方案的信息,请阅读
以下文章:[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
引用>
我的项目有src/main/docker这个文件,怎么解决
将项目路径添加到dockerDirectory:
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
pom.xml: p>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- tag::plugin[] -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
<!-- end::plugin[] -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
请查看我的stackoverflow:
https://stackoverflow.com/questions/47308102/ failedto -execute- target -com-spotifydocker-maven-plugin1-0- 0build-excep-cau
div>
Read More:
- [Solved] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project Hello
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Failed to execute goal in Maven build org.apache.tomcat .maven:
- Failed to execute goal org.apache.maven . plugins:maven-surefire-plugin :2.12.4:test
- Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign
- RocketMQ Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check…
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0
- 解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
- Failed to execute goal org.apache.tomcat . maven:tomcat7-maven-plugin : 2.2: run solution
- How to Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
- Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on
- Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project
- Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (default) on project
- Error: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2
- Error resolving version for plugin ‘org.apache.maven.plugins:maven-compiler-plugin’ from the repo…
- Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:repackage failed
- Failed to execute goal org.apache.maven . plugins:maven-clean-plugin :2.6.1:cle