You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "kwin (via GitHub)" <gi...@apache.org> on 2026/03/05 11:39:14 UTC

[I] Drop (non-working) support for unnamed package [maven-shade-plugin]

kwin opened a new issue, #793:
URL: https://github.com/apache/maven-shade-plugin/issues/793

   ### Affected version
   
   3.6.2
   
   ### Bug description
   
   In https://github.com/apache/maven-shade-plugin/issues/461 there was a use case described to move a package from [unnamed/default package](https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4.2) to another package.
   Although back then there was a fix provided which prevents a NPE I don't think this was ever working fully due to these reasons:
   
   - Moving from unnamed to some other package requires *new* import statement for referencing code (those are not generated by m-shade-p). Compare with 
   
     > A type in an unnamed package ([ยง7.4.2](https://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.4.2)) has no canonical name, so the requirement for a canonical name in every kind of import declaration implies that (a) types in an unnamed package cannot be imported...
     
     (from https://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.5)
   - Calling some of the `relocate` methods from `SimpleRelocator` where pattern is the empty string leads to incorrect results
   
   Given that I would therefore recommend to bail out with an exception whenever there is a relocation given without a `pattern`
   
   ```
   <relocation>
       <pattern />
       <shadedPattern>org.example.foo.bar</shadedPattern>
     </relocation>
   ```
   
   or
   
   ```
   <relocation>
       <shadedPattern>org.example.foo.bar</shadedPattern>
     </relocation>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Drop (non-working) support for unnamed package [maven-shade-plugin]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin closed issue #793: Drop (non-working) support for unnamed package
URL: https://github.com/apache/maven-shade-plugin/issues/793


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Drop (non-working) support for unnamed package [maven-shade-plugin]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on issue #793:
URL: https://github.com/apache/maven-shade-plugin/issues/793#issuecomment-4004453689

   It was even stated in https://github.com/apache/maven-shade-plugin/issues/461#issuecomment-2972863907
   
   > This is narrow patch addressing only the reported NullPointerException.
       For more sophisticated handling of default packages, IMHO extra functionality is needed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org