开发者

Is it possible to get the final name of a dependency via Mavens properties?

开发者 https://www.devze.com 2023-02-07 04:12 出处:网络
It\'s possible to get the final name of the current project. ${project.build.finalName} Is this also possible for dependencies? I\'m searching for something like this:

It's possible to get the final name of the current project.

${project.build.finalName}

Is this also possible for dependencies? I'm searching for something like this:

${project.build.dependencies.0.finalName}

Based on this example pom dependency cutout.

<dependency>
  <groupId>org.stack开发者_JS百科overflow</groupId>
  <artifactId>stackoverflow-question</artifactId>
  <version>1.6.0-SNAPSHOT</version>
</dependency>

The final name will likely be stackoverflow-question-1.6.0-SNAPSHOT, but as this may be variable due to locked snapshots or releases, I wan't to read it dynamically. Can you help me with that? Thank you very much.


Thank you all, I found it by myself hidden in this stackoverflow question.

<property name="log4j" value="${maven.dependency.log4j.log4j.jar.path}"/>
<echo message="${log4j}"/>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号