我目前正在尝试部署 javafx 本机捆绑包。虽然这基本上可以正常工作,但它不会部署到<nativeOutputDir>
使用 build-helper-maven-plugin 及其 regex-property 目标的构造属性给定的任何位置。
这是我的pom:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>regex-property</id>
<goals>
<goal>regex-property</goal>
</goals>
<configuration>
<name>replaced.deploydir</name>
<value>${project.version}</value>
<regex>.+SNAPSHOT</regex>
<replacement>C:\\\\temp\\\\snapDir</replacement>
<failIfNoMatch>true</failIfNoMatch>
<failOnError>true</failOnError>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<configuration>
<mainClass>foo.bar.StartApp</mainClass>
<nativeOutputDir>${replaced.deployDir}</nativeOutputDir>
<nativeReleaseVersion>1.1.0</nativeReleaseVersion>
<updateExistingJar>true</updateExistingJar>
<additionalAppResources>${basedir}/target/extra-resources</additionalAppResources>
<appName>InstructionGen</appName>
</configuration>
</plugin>
</plugins>
</build>
现在,当我仅使用 Maven 属性标签传递属性时,nativeInstaller 将被部署到正确的位置。
虽然这可能与 [问题] 相关:(Maven build-helper-maven-plugin 正则表达式无法使用属性作为 dependency.version)。在我看来,这个问题不支持答案。替换发生的阶段是“验证”,而 javafx-maven-plugin 构建捆绑包的阶段是“包”,因此顺序应该是正确的。我使用 antrun-plugin 进行测试,以查看是否创建了该属性,并且确实如此。有趣的事实:当我在类似之后添加一些东西${replaced.deployDir}
时,<nativeOutputDir>
它<nativeOutputDir>${replaced.deployDir}\\test</nativeOutputDir>
会部署到projectname\target\${replaced.deployDir}\test
创建未解析的${replaced.deployDir}
文件夹。
任何帮助表示赞赏。