maven 如何跳过pom.xml中的属性

disho6za  于 2023-08-03  发布在  Maven
关注(0)|答案(1)|浏览(151)

我想在pom.xml中设置属性值true,在脚本中设置false-pom.xml-

<properties>
            <swagger.codegen.plugin.version>3.0.0-rc0</swagger.codegen.plugin.version>`enter code here`
            <swagger.codegen.plugin.version>3.0.3</swagger.codegen.plugin.version>
            <swagger.codegen.generators.version>1.0.3</swagger.codegen.generators.version>
            <swagger.lang>jaxrs-jersey</swagger.lang>
        </properties>

字符串
check.sh-

mvn validate -Dmaven.exec.skip -DskipTests -P copyright,license


我已经添加了跳过标签,但它不为这个插件工作

<plugin>
            <groupId>io.swagger.codegen.v3</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>${swagger.codegen.plugin.version}</version>
            <executions>
                <execution>
                    <id>generate-folder-pojo</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <configuration>
                        <skip>true</skip>
                        <inputSpec>${swagger.inputSpec}/folder_definition.json</inputSpec>
                        <language>${swagger.lang}</language>
                        <templateDirectory>${swagger.api}/template</templateDirectory>
                        <verbose>false</verbose>
                  
                    </configuration>
                </execution>
                </executions>
                </plugin>

ubby3x7f

ubby3x7f1#

而不是

<skip>true</skip>

字符串
试试看

<skip>${maven.exec.skip}</skip>

相关问题