如何使用带有Maven的javafx-ant将文件夹放在特定位置?

时间:2015-07-14 15:13:48

标签: ant maven-3 javafx-8

我已将我的构建从简单的ANT升级到Maven以管理依赖项。我的第三方罐子之一需要放置在特定位置的支持文件。

我设法创建了一个简单的pom.xml来编译应用程序并生成EXE安装程序。但是,我无法将此文件放在特定的文件夹位置。

应用程序构建时&部署它应该放在这个位置:

${project.build.directory}/deploy/bundles/MyApplication/app/{custom-folder}/*.properties

这需要将它正确地捆绑在安装程序中 - 但是我无法找到为特定文件指定特定位置的方法。

遵循此模式(仅显示POM的相关部分):

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>

<taskdef name="jfxdeploy" classname="com.sun.javafx.tools.ant.DeployFXTask" classpathref="maven.plugin.classpath" />
    <jfxdeploy outdir="${project.build.directory}/deploy" outfile="${build.finalName}" nativeBundles="all">
    <resources>                         
        <fileset dir="${project.build.directory}" includes="*.jar" />
        <fileset dir="${project.build.directory}/dependency" includes="*.jar" />
        <fileset dir="${project.build.directory}/properties" includes="*.properties" />
   </resources>
....

这会将* .properties文件放在

位置
${project.build.directory}/deploy/bundles/MyApplication/app

有没有办法将它放在这个位置的子文件夹中?

由于

1 个答案:

答案 0 :(得分:0)

我找到了这个问题的答案。我需要更改文件集中的映射,如下所示:

<fileset dir="${project.build.directory}" includes="properties/*.properties"/>

这将它置于需要的位置。