Maven:编译时将可执行文件(.exe)移动到目标文件夹中
Maven: Move Executable (.exe) into target Folder when Compiling
所以我在编译我的项目时尝试了不同的方法来将我想要的、必要的 .exe 文件复制到目标文件夹中。
我还检查了 Move a text file into target folder when compiling a Maven project 的问答 - 但它没有帮助。
所以我想要的是在编译工程的时候把'chromedriver.exe'复制到目标文件夹中(withmvn clean install
)。我需要这个 .exe 来启动我的 jar 文件。
感谢任何帮助!
如果您使用默认配置,放置在 src/main/resources 中的任何文件都将自动包含在生成的 build(target) 文件夹中。但是,您应该只包含应包含在生成的 jar 中的文件。
我找到了自己的解决方案:
在 pom.xml 中,包括
<resources>
<resource>
<directory>${project.basedir}</directory>
<targetPath>${project.build.directory}</targetPath>
<includes>
<include>chromedriver.exe</include>
</includes>
</resource>
</resources>
在 build
标签下。
所以我在编译我的项目时尝试了不同的方法来将我想要的、必要的 .exe 文件复制到目标文件夹中。 我还检查了 Move a text file into target folder when compiling a Maven project 的问答 - 但它没有帮助。
所以我想要的是在编译工程的时候把'chromedriver.exe'复制到目标文件夹中(withmvn clean install
)。我需要这个 .exe 来启动我的 jar 文件。
感谢任何帮助!
如果您使用默认配置,放置在 src/main/resources 中的任何文件都将自动包含在生成的 build(target) 文件夹中。但是,您应该只包含应包含在生成的 jar 中的文件。
我找到了自己的解决方案: 在 pom.xml 中,包括
<resources>
<resource>
<directory>${project.basedir}</directory>
<targetPath>${project.build.directory}</targetPath>
<includes>
<include>chromedriver.exe</include>
</includes>
</resource>
</resources>
在 build
标签下。