【问题标题】:Configure maven task-segment in pom file在 pom 文件中配置 maven 任务段
【发布时间】:2024-05-15 20:00:02
【问题描述】:

我的项目目前使用 Ant 构建,来构建我使用以下目标的 SQL:

<target name="build.update_database">
    <artifact:mvn pom="${basedir}/../module-database/pom.xml">
        <arg value="clean"/>
        <arg value="compile"/>
        <arg value="liquibase:updateSQL"/>
    </artifact:mvn>
</target>

现在我想移动 Maven,如何在 pom.xml 中配置步骤 'clean'、'compile'、'liquibase:updateSQL'。

pom.xml 是:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
                <debug>true</debug>
                <encoding>UTF-8</encoding>
                <optimize>true</optimize>
                <showDeprecation>true</showDeprecation>
                <showWarnings>true</showWarnings>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>2.0.5</version>
            <configuration>
                <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
                <propertyFile>src/main/resources/liquibase.properties</propertyFile>
                <verbose>true</verbose>
            </configuration>
        </plugin>
    </plugins>

</build>

【问题讨论】:

    标签: maven pom.xml


    【解决方案1】:

    您不需要其他任何东西。您已经有了 pom.xml 文件。 Ant Mvn Task 执行 Maven 命令。这就像在命令行中执行mvn clean compile liquidbase:updateSQL

    【讨论】:

      最近更新 更多