[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16831839#comment-16831839 ] Hudson commented on MSHADE-316: --- Build succeeded in Jenkins: Maven TLP » maven-shade-plugin » master #6 See https://builds.apache.org/job/maven-box/job/maven-shade-plugin/job/master/6/ > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Assignee: Robert Scholte >Priority: Major > Fix For: 3.2.2 > > Time Spent: 40m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16831202#comment-16831202 ] Hudson commented on MSHADE-316: --- Build succeeded in Jenkins: Maven TLP » maven-shade-plugin » master #5 See https://builds.apache.org/job/maven-box/job/maven-shade-plugin/job/master/5/ > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Assignee: Robert Scholte >Priority: Major > Fix For: 3.2.2 > > Time Spent: 0.5h > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16831186#comment-16831186 ] Hudson commented on MSHADE-316: --- Build succeeded in Jenkins: Maven TLP » maven-shade-plugin » MSHADE-316 #2 See https://builds.apache.org/job/maven-box/job/maven-shade-plugin/job/MSHADE-316/2/ > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Assignee: Robert Scholte >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16817556#comment-16817556 ] Markus Karg commented on MSHADE-316: [~rfscholte] All requested changes are implemented. Please continue review [https://github.com/apache/maven-shade-plugin/pull/19]. :) > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816997#comment-16816997 ] Markus Karg commented on MSHADE-316: [~rfscholte] Provided PR that implements excludeDefaults=true as you requested. Please review [https://github.com/apache/maven-shade-plugin/pull/19]. :) > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816917#comment-16816917 ] Markus Karg commented on MSHADE-316: [~rfscholte] Fully agree with all you say. But see, it is the same for me, too. So I think you understand that it is not funny to squander one day of volunteer time with the wrong solution. > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816896#comment-16816896 ] Robert Scholte commented on MSHADE-316: --- Well, the more people that ask for my opinion, the less time I have to really dive into every issue. And it is all spare time, maintaining all Maven projects is voluntary job. > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816890#comment-16816890 ] Markus Karg commented on MSHADE-316: [~rfscholte] Ok I will create another PR implementing that alternative solution. :-) Just too bad that you didn't tell me earlier as a reaction upon my comment of April 4 where I let you choose your preference and proposed exactly what you now want in your recent comment... ;-( > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816885#comment-16816885 ] Robert Scholte commented on MSHADE-316: --- bq. As of version 1.6, minimizeJar will respect classes that were specifically marked for inclusion in a filter. Note that specifying an include filter for classes in an artifact implicitly excludes all non-specified classes in that artifact. That's the last line on the page and that explains the current behavior. It also kind of indicates what the preferred solution should be: {code:xml} true log4j:log4j false somefile {code} [Reporting|https://maven.apache.org/ref/3.6.1/maven-model/maven.html#class_reporting] has a similar option, so I'd prefer to follow that. > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816652#comment-16816652 ] Markus Karg commented on MSHADE-316: [~rfscholte] It is definitively *not* possible with the existing plugin, as a single include _automatically excludes all other classes_. The fact that de-facto the existing plugin does that bad behavior, is the cause why I spend a day to implement it. You _cannot_ specify a single class exemption for the minijar filter without my PR (been there). > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816569#comment-16816569 ] Robert Scholte commented on MSHADE-316: --- Looks very much like [https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html] . It sounds like xml config-based Spring, which should suffer with the same issues. I would need to analyze that, but I would expect it is already supported. > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816509#comment-16816509 ] Markus Karg commented on MSHADE-316: [~rfscholte] No, this is a misunderstanding. The idea is *not* to have full control over the classes being added. The idea is (see also my PR) is to *prevent minjar's removal of explicitly marked classes*. Use case: A dependency shall get included into a shaded jar, but that dependency is loaded by *Reflection*, so the original artifact does not directly reference the *Class* to load, but only holds a *String* with the class name. The Minijar filter will remove that class, so the shaded JAR will be broken. With my PR, you can add an _explicit minijar exemption_ on that single class name (or pattern), so minijar will keep that file even *without a technically detectable* need. This cannot be done with the existing include filters, because once _at least one_ include is explictly defined, the default (include _all_) is switched off so _all_ other classes would be _excluded_. The solution is my PR which simply provides an *exemption* for Minijar. There is a rather popular real-life scenario: Minijar breaks _Eclipse Jersey_ because one of Jersey's dependency is loaded by Reflection. > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16816031#comment-16816031 ] Robert Scholte commented on MSHADE-316: --- So if I read this correctly, you have control which classes under target/classes should be part of the minified jar? What's the idea behind this? Shouldn't simply all these files be added? > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16815665#comment-16815665 ] Markus Karg commented on MSHADE-316: [~rfscholte] Please review PR https://github.com/apache/maven-shade-plugin/pull/18. :-) > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16811090#comment-16811090 ] Markus Karg commented on MSHADE-316: Default includes are defined by JavaDocs as "By default, all files are included and no files are excluded.", hence: "**/*" PR will follow. > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810709#comment-16810709 ] Robert Scholte commented on MSHADE-316: --- I don't see default includes in the minijar filter, so I guess I'm missing something. And yes, a PR would be great! > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MSHADE-316) Explicit minijar includes
[ https://issues.apache.org/jira/browse/MSHADE-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810254#comment-16810254 ] Markus Karg commented on MSHADE-316: [~rfscholte] Shall I provide a PR for that? For which solution, "explicit minijar exceptions" or "useDefaultIncludes=true"? Both solve the same problem, but have different side aspects (positive and negative). > Explicit minijar includes > - > > Key: MSHADE-316 > URL: https://issues.apache.org/jira/browse/MSHADE-316 > Project: Maven Shade Plugin > Issue Type: Improvement >Reporter: Markus Karg >Priority: Major > > Minijar currently respects includes, but these have a drawback: Once you > defined an include, the _default includes_ are gone! But what you actually > want to have when combining minijar with includes is just an "exception" to > minijar's filtering, not a complete replacement of the default includes! > So what we need to make this work intuitively is either "explicit minijar > exceptions", or a "useDefaultIncludes=true" option that turns the notion from > "replace default includes by the single given include" to "add the single > given include ontop of the default includes". -- This message was sent by Atlassian JIRA (v7.6.3#76005)