Skip to content

Commit fd45303

Browse files
committed
[MSHARED-777] Remove deprecated main attributes from generated manifest
1 parent 48ee0df commit fd45303

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

src/main/java/org/apache/maven/archiver/MavenArchiver.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,18 +474,11 @@ private void handleImplementationEntries( MavenProject project, Map<String, Stri
474474
{
475475
addManifestAttribute( m, entries, "Implementation-Title", project.getName() );
476476
addManifestAttribute( m, entries, "Implementation-Version", project.getVersion() );
477-
// MJAR-5
478-
addManifestAttribute( m, entries, "Implementation-Vendor-Id", project.getGroupId() );
479477

480478
if ( project.getOrganization() != null )
481479
{
482480
addManifestAttribute( m, entries, "Implementation-Vendor", project.getOrganization().getName() );
483481
}
484-
485-
if ( project.getUrl() != null )
486-
{
487-
addManifestAttribute( m, entries, "Implementation-URL", project.getUrl() );
488-
}
489482
}
490483

491484
private void handleSpecificationEntries( MavenProject project, Map<String, String> entries, Manifest m )

src/site/apt/examples/manifest.apt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,9 @@ Specification-Version: ${project.artifact.selectedVersion.majorVersion}.${projec
8686
Specification-Vendor: ${project.organization.name}
8787
Implementation-Title: ${project.name}
8888
Implementation-Version: ${project.version}
89-
Implementation-Vendor-Id: ${project.groupId}
9089
Implementation-Vendor: ${project.organization.name}
91-
Implementation-URL: ${project.url}
9290
+-----+
9391

9492
<<Note:>> If your pom.xml does not have an <<<\<organization\>>>>/<<<\<name\>>>>
9593
element, then the <<<Specification-Vendor>>> and <<<Implementation-Vendor>>>
9694
entries will <<not>> be in the manifest.
97-
98-
<<Note:>> If your pom.xml does not have a <<<\<url\>>>> element, referenced through interpolation,
99-
then the <<<Implementation-URL>>> entry will <<not>> be in the manifest.

src/site/xdoc/index.xml.vm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@
198198
<source>
199199
Implementation-Title: \${project.name}
200200
Implementation-Version: \${project.version}
201-
Implementation-Vendor-Id: \${project.groupId}
202201
Implementation-Vendor: \${project.organization.name}
203-
Implementation-URL: \${project.url}
204202
</source>
205203
The default value is <code>false</code>.
206204
</td>
@@ -348,4 +346,4 @@ artifactId=\${project.artifactId}
348346
</subsection>
349347
</section>
350348
</body>
351-
</document>
349+
</document>

src/test/java/org/apache/maven/archiver/MavenArchiverTest.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void testRecreation()
260260
FileUtils.deleteDirectory( "target/maven-archiver" );
261261
archiver.createArchive( session, project, config );
262262
assertTrue( jarFile.exists() );
263-
263+
264264
long history = System.currentTimeMillis() - 60000L;
265265
System.out.println( "history: " + history );
266266
jarFile.setLastModified( history );
@@ -276,7 +276,7 @@ public void testRecreation()
276276
archiver.createArchive( session, project, config );
277277
// Is the assumption correct that the jar file itself
278278
// should have the same last modified time as the files itself ?
279-
279+
280280
// Based on some experiments with a result like this:
281281
// History 1532810292406 time:1532810292000 expected:<1532810352000> but was:<1532810292000>
282282
// It looks like a JDK Bug: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8177809
@@ -497,9 +497,7 @@ public void testDeprecatedCreateArchiveAPI()
497497

498498
assertEquals( "archiver test", manifest.get( Attributes.Name.IMPLEMENTATION_TITLE ) );
499499
assertEquals( "0.1.1", manifest.get( Attributes.Name.IMPLEMENTATION_VERSION ) );
500-
assertEquals( "org.apache.dummy", manifest.get( Attributes.Name.IMPLEMENTATION_VENDOR_ID ) );
501500
assertEquals( "Apache", manifest.get( Attributes.Name.IMPLEMENTATION_VENDOR ) );
502-
assertEquals( "http://maven.apache.org", manifest.get( Attributes.Name.IMPLEMENTATION_URL ) );
503501

504502
assertEquals( System.getProperty( "java.version" ), manifest.get( new Attributes.Name( "Build-Jdk" ) ) );
505503
assertEquals( System.getProperty( "user.name" ), manifest.get( new Attributes.Name( "Built-By" ) ) );
@@ -549,9 +547,7 @@ public void testManifestEntries()
549547

550548
assertEquals( "archiver test", manifest.get( Attributes.Name.IMPLEMENTATION_TITLE ) );
551549
assertEquals( "0.1.1", manifest.get( Attributes.Name.IMPLEMENTATION_VERSION ) );
552-
assertEquals( "org.apache.dummy", manifest.get( Attributes.Name.IMPLEMENTATION_VENDOR_ID ) );
553550
assertEquals( "Apache", manifest.get( Attributes.Name.IMPLEMENTATION_VENDOR ) );
554-
assertEquals( "http://maven.apache.org", manifest.get( Attributes.Name.IMPLEMENTATION_URL ) );
555551

556552
assertEquals( "org.apache.maven.Foo", manifest.get( Attributes.Name.MAIN_CLASS ) );
557553

0 commit comments

Comments
 (0)