From
https://maven.apache.org/shared/maven-archiver/examples/manifestEntries.html:
*Note:* If your pom.xml does not have the |<url>| element, referenced
through interpolation, then the entry |url| will *not* be in the manifest.
I've been trying to figure out what this means. What I /thought/ it
meant was, if `${project.url}` was /not/ set, then `url` would not be in
the manifest.
Expected manifest without `url` set (see sample pom diff -- `foo:`
should be there if I read the docs correctly):
|Manifest-Version: 1.0
Created-By: Maven JAR Plugin 3.4.1
Build-Jdk-Spec: 21
foo:
mode: development
|
Actual manifest without `url` set:
|Manifest-Version: 1.0
Created-By: Maven JAR Plugin 3.4.1
Build-Jdk-Spec: 21
foo:
mode: development
url: |
Sample pom originally generated by `mvn archetype:generate
-DarchetypeArtifactId=maven-archetype-quickstart
-DgroupId=org.openstreetmap.josm -DartifactId=testInheritedManifest`
|diff --git a/pom.xml b/pom.xml
index 4b21a0c..e39bfa4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,6 @@
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>testInheritedManifest</name>
- <url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -15,4 +14,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.4.1</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <mode>development</mode>
+ <foo></foo>
+ <url>${project.url}</url>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>|
My usecase is for a project with many plugins, where I'd like to specify
the manifest entries /once/ in a parent pom and then set the appropriate
properties in the child poms. Ideally the null entries wouldn't appear
in every pom. This is a conversion from ant+ivy to maven (AKA a
pre-existing project).
After a bit of debugging, I /think/ that the note on
https://maven.apache.org/shared/maven-archiver/examples/manifestEntries.html
means something like:
*Note:* If your pom.xml does not have the |<url>| element, referenced
through interpolation, then the entry |url| will**be *empty* in the
manifest.
Either that or I found a bug. I'm inclined more towards the former since
I didn't see anything that would indicate that an entry was interpolated
(both `foo` and `url` in the map were `null`), but I am by no means an
expert.
It is also possible that I completely misunderstood the sentence.
So my question:
What is the referenced sentence trying to say? Is it outdated
documentation? Is it a bug in the current implementation?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org