apache / apache/maven-shade-plugin

`ApacheNoticeResourceTransformer` not injecting project name

Open
#742 1 comment 0 reactions 0 assignees View on GitHub
bug priority:minor
Dominant language
Java
Stars
188
Forks
103
Avg merge
16h 39m
Merged PRs (30d)
4

Description

### Affected version

3.6.0

### Bug description

When generating a `NOTICE` using `ApacheNoticeResourceTransformer`, the project name is not injected (or more likely, resolved) as expected, e.g. the output is:
> // ------------------------------------------------------------------
// NOTICE file corresponding to the section 4d of The Apache License,
// Version 2.0, in this case for
// ------------------------------------------------------------------

Not, something like this as you might expect:
https://github.com/apache/amoro/blob/0e34e89dcfc8b5c5b5da285786004965d5b70bc6/NOTICE-binary#L1-L4

https://github.com/apache/maven-shade-plugin/blob/256eab83c008a1e701b16aad0b473c588a3560aa/src/main/java/org/apache/maven/plugins/shade/resource/ApacheNoticeResourceTransformer.java#L100

Reproducer:
Simple `pom.xml`:
```

4.0.0
com.me
0.0.1
maven-shade-notice-reproducer
Maven Shade Notice Reproducer



org.apache.maven.plugins
maven-shade-plugin
3.6.0


package

shade













org.apache.commons
commons-lang3
3.18.0

```

Windows command to build and print the contents of the `NOTICE`:
`mvn clean package && jar -xf target\maven-shade-notice-reproducer-0.0.1.jar && type META-INF\NOTICE`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the supplied pom.xml and Windows Maven command, then locate ApacheNoticeResourceTransformer in the plugin sources and compare its behavior with the referenced implementation. Verify that the generated META-INF/NOTICE includes the project name, using the provided expected output as the completion criterion.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.