简体   繁体   English

引用Maven pom.xml中生成的jar

[英]Referring to a generated jar inside a Maven pom.xml

In my pom.xml file I have the maven-shade-plugin for generating an uber jar. 在我的pom.xml文件中,我具有用于生成uber jar的maven-shade-plugin This uber jar has the version of my app in it, such as app-1.0.0-SNAPSHOT.jar . 此uber jar中包含我的应用程序的版本,例如app-1.0.0-SNAPSHOT.jar Then, I use the launch4j-maven-plugin to wrap that into an exe file, but to achieve that I have a configuration that looks like this: 然后,我使用launch4j-maven-plugin将其包装到一个exe文件中,但是要实现这一点,我需要一个如下配置:

<configuration>
    <jar>target/app-1.0.0-SNAPSHOT.jar</jar>

Is there a way to use a variable or placeholder here and not to have to hard-code the filename of the jar? 有没有办法在这里使用变量或占位符,而不必对罐子的文件名进行硬编码?

This will be: 这将是:

${project.build.directory}/${project.build.finalName}.jar

Please see: 请参见:

Maven project.build.directory Maven project.build.directory

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM