[
https://issues.apache.org/jira/browse/MJAR-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17607916#comment-17607916
]
b. ohnsorg commented on MJAR-62:
--------------------------------
maven-jar-plugin uses [MavenArchiver|https://github.com/apache/maven-archiver].
MavenArchiver depends on [Plexus
Archiver|https://github.com/codehaus-plexus/plexus-archiver]. PlexusArchiver
uses java.util.spi.ToolProvider. Instead
https://cwiki.apache.org/confluence/display/MAVENOLD/Toolchains suggests
(omitted some checks for brevity):
{code}
/**
* @component
*/
private ToolchainManager toolchainManager;
/**
* The current build session instance. This is used for
* toolchain manager API calls.
*
* @parameter expression="${session}"
* @required
* @readonly
*/
private MavenSession session;
public void execute() {
.....
// get toolchain from context
Toolchain tc = toolchainManager.getToolchainFromBuildContext( "jdk",
//NOI18N
session );
javadocExecutable = tc.findTool( "javadoc" ); //NOI18N
}
{code}
I assume that none of the Plexus-provided archivers supports toolchains by any
means. This is either not a simple patch to maven-jar-plugin since it requires
replacement of manifest generation. Or it spans across all the projects
mentioned to put ToolchainManager down the stream.
> Build-Jdk in Manifest.mf does not reflect which compiler version actually
> compiled the classes in the jar
> ---------------------------------------------------------------------------------------------------------
>
> Key: MJAR-62
> URL: https://issues.apache.org/jira/browse/MJAR-62
> Project: Maven JAR Plugin
> Issue Type: Bug
> Reporter: Stefan Magnus Landrø
> Priority: Major
> Attachments: example-app.zip
>
>
> Manifest.mf does not reflect the version of the compiler that built the jar,
> but defaults to the version that maven runs under: Build-Jdk:
> ${java.version}.
> I believe this makes users uncertain of which compiler was actually used to
> build the classes.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)