microservice-package-maven-plugin通过命令行跳过容器构建

时间:2018-06-07 13:15:53

标签: maven cumulocity

我正在使用microservice-package-maven-plugin构建一个微服务来打包docker容器。这在构建服务器上运行良好,但我想关闭我的开发环境中的docker包装,因为我使用的是Windows,因此没有docker。目前我正在编辑pom.xml true ..和true ... 有没有更好的方法来实现这一目标?

我可以在我的maven构建中添加一些命令行吗? > mvn clean insatll -Dmicroservice.containerSkip = true?

或者我应该介绍maven个人资料?

提前致谢

2 个答案:

答案 0 :(得分:0)

您要查找的参数是:

  • skip.agent.package(一般跳过包装)
  • skip.agent.package.rpm(跳过rpm包装)
  • skip.agent.package.container(跳过码头工人容器包装)
  • skip.microservice.package(跳过微服务拉链包装)

您可以使用从命令行构建时所描述的任何参数。

mvn clean install -Dskip.agent.package.rpm=false -Dskip.agent.package.container=true

答案 1 :(得分:0)

我来晚了一点,但这对我有用:

在pom中创建一个属性:

<properties>
     <skip-docker-image>false</skip-docker-image>
</properties>

使用插件配置中的属性:

<configuration>
     <skip>${skip-docker-image}</skip>
</configuration>

在需要时更改属性:

mvn clean install -Dskip-docker-image=true