Maven跳过插件环节

定义属性

<properties>
	<!-- only compile isntall on dev , not tar docker -->
	<skipDocker>false</skipDocker>
</properties>

设置插件是否跳过的属性

<plugin>
    <groupId>io.fabric8</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>${docker.plugin.version}</version>
    <configuration>
        <dockerHost>${docker.host}</dockerHost>
        <registry>${docker.registry}</registry>
        <authConfig>
            <push>
                <username>${docker.username}</username>
                <password>${docker.password}</password>
            </push>
        </authConfig>
        <images>
            <image>
                <name>${docker.registry}/${docker.namespace}/${project.name}:${project.version}</name>
                <build>
                    <assembly>
                        <descriptorRef>artifact</descriptorRef>
                    </assembly>
                    <contextDir>${project.basedir}/src/main/docker/</contextDir>
                </build>
            </image>
        </images>
        <skip>${skipDocker}</skip>
    </configuration>
    <executions>
        <execution>
            <id>build</id>
            <phase>package</phase>
            <goals>
                <goal>build</goal>
            </goals>
        </execution>
    </executions>
</plugin>

运行命令

mvn clean install -DskipTests=true -DskipDocker=true
上一篇:idea中启动工程报错:idea Error: Could not create the Java Virtual Machine. Error: A fatal exception has occu


下一篇:IDEA导入spring源码Unable to find method ‘org.gradle.api.artifacts.result.ComponentSelectionReason.getDes