add default entries as build time to MANIFEST.MF file in Maven

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Start with the master POM's build plugins section and search the other POM files for maven-jar-plugin usage. Verify the requested manifest configuration and timestamp properties against the Maven build, then confirm that generated MANIFEST.MF files contain the default implementation/specification entries and Build-Time value.

Written by the indexing model from the issue text.

Description

in master pom file you could add this snipped to implement the above:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>false</addClasspath>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                    </manifest>
		<manifestEntries>
		    <Build-Time>${maven.build.timestamp}</Build-Time>
		</manifestEntries>						
                </archive>
            </configuration>
        </plugin>

as first child of

also search in the other pom files where maven-jar-plugin is been used and add this to them:

		<manifestEntries>
		    <Build-Time>${maven.build.timestamp}</Build-Time>
		</manifestEntries>	

In order to add Build-Time into the MANIFEST.MF file

		<properties>
			<timestamp>${maven.build.timestamp}</timestamp>
			<maven.build.timestamp.format>yyyyMMdd'-'HHmmss</maven.build.timestamp.format>
		</properties>

https://github.com/redisson/redisson/issues/2185

Dominant language
Python
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from davideuler/programming-tips

All issues in davideuler/programming-tips

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.