tl;dr: I'm trying to solve this issue.
I have a project which builds a platform-dependent JAR and adds a classifier according to the os-maven-plugin:
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.levyfan</groupId>
<artifactId>sentencepiece</artifactId>
<version>0.0.2</version>
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.6.1</version>
</extension>
</extensions>
<!-- ... -->
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<classifier>${os.detected.classifier}</classifier>
</configuration>
</plugin>
</plugins>
</build>
When I build and publish the artrifact with mvn --batch-mode deploy
to GitHub Packages, I'm met with a conflict error. This is because the artifacts share a pom (sentencepiece-0.0.2.pom
), but the JAR artifact is determined by the os-maven-plugin
value (sentencepiece-0.0.2-XYZ.jar
).
How can I inject this plugin-defined property at build-time to create unique artifact names?