首页 > 解决方案 > 如何将其他插件与 JavaFX Maven 插件结合使用?

问题描述

我将 Git 提交 ID 插件与 JavaFX Maven 插件一起使用。不幸的是,Git 提交 ID 插件“修订”目标仅由 执行mvn compile,而不是由执行,mvn javafx:compile因此我需要同时运行两者才能成功运行我的程序。我怎样才能mvn javafx:compile执行 Git 提交 ID 插件的“修订”目标,这样我就不需要双重编译?

相关 POM 部分

    <build>
    <sourceDirectory>[...]</sourceDirectory>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <release>${maven.compiler.release}</release>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>0.0.3</version>
            <configuration>
                <mainClass>[...]</mainClass>
            </configuration>
        </plugin>
        <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>
            <version>3.0.0</version>
            <executions>
                <execution>
                    <id>get-the-git-infos</id>
                    <goals>
                        <goal>revision</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                <prefix>git</prefix>
                <verbose>false</verbose>
                <generateGitPropertiesFile>true</generateGitPropertiesFile>
                <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
                <format>properties</format>
                <gitDescribe>
                    <skip>false</skip>
                    <always>false</always>
                    <dirty>-dirty</dirty>
                </gitDescribe>
            </configuration>
        </plugin>
    </plugins>
</build>

标签: mavenjavafxpluginspom.xml

解决方案


推荐阅读