[jira] Commented: (MSHADE-95) test-scoped artifact excluded, even if it is also a transitive dep
[ https://jira.codehaus.org/browse/MSHADE-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275827#comment-275827 ] Alan D. Salewski commented on MSHADE-95: Sorry, fell off of my radar. Thanks for the ping, Benson; I won't have time to look at this until midweek (at least), though. > test-scoped artifact excluded, even if it is also a transitive dep > -- > > Key: MSHADE-95 > URL: https://jira.codehaus.org/browse/MSHADE-95 > Project: Maven 2.x Shade Plugin > Issue Type: Bug >Affects Versions: 1.3.2, 1.4 > Environment: (cygwin) > Apache Maven 3.0.1 (r1038046; 2010-11-23 05:58:32-0500) > Java version: 1.6.0_23 > Java home: C:\Program Files\Java\jdk1.6.0_23\jre > Default locale: en_US, platform encoding: Cp1252 > OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows" >Reporter: Alan D. Salewski > > A test-scoped artifact is excluded from the final jar, even if that artifact > is also a transitive dependency of some other (non-test-scoped) dep. > {noformat} > MY_POM > | > | > +-- dep A (scope: test) > | > | > +-- dep B (scope: compile) > | > | > +-- dep A (scope: compile) > {noformat} > In the above scenario, I would expect '{{dep A}}' to be included in the final > jar, even though it's in the '{{test}}' scope in my POM. The rationale is > that it is required for '{{dep B}}' to run; its absence will result in a > {{java.lang.ClassNotFoundException}} at runtime. > Behavior observed with maven-shade-plugin versions 1.3.2 and 1.4; other > versions not tested. > I'll put together a test case later tonight when I have more time and attach > it here. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (MSHADE-95) test-scoped artifact excluded, even if it is also a transitive dep
test-scoped artifact excluded, even if it is also a transitive dep -- Key: MSHADE-95 URL: http://jira.codehaus.org/browse/MSHADE-95 Project: Maven 2.x Shade Plugin Issue Type: Bug Affects Versions: 1.4, 1.3.2 Environment: (cygwin) Apache Maven 3.0.1 (r1038046; 2010-11-23 05:58:32-0500) Java version: 1.6.0_23 Java home: C:\Program Files\Java\jdk1.6.0_23\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows" Reporter: Alan D. Salewski A test-scoped artifact is excluded from the final jar, even if that artifact is also a transitive dependency of some other (non-test-scoped) dep. {noformat} MY_POM | | +-- dep A (scope: test) | | +-- dep B (scope: compile) | | +-- dep A (scope: compile) {noformat} In the above scenario, I would expect '{{dep A}}' to be included in the final jar, even though it's in the '{{test}}' scope in my POM. The rationale is that it is required for '{{dep B}}' to run; its absence will result in a {{java.lang.ClassNotFoundException}} at runtime. Behavior observed with maven-shade-plugin versions 1.3.2 and 1.4; other versions not tested. I'll put together a test case later tonight when I have more time and attach it here. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-2399) file size check on pom.xml (or thing specified by --file opt) should only apply to regular files (patch attached)
[ http://jira.codehaus.org/browse/MNG-2399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_98073 ] Alan D. Salewski commented on MNG-2399: --- Well, one reason for reading the pom from a named pipe is that it facilitates using '{{mvn}}' from within shell scripts for performing tasks that leverage built\-in maven capabilities. For example, the attached '{{mvn\-get\-plugin}}' script retrieves and installs one or more maven plugins using a shell "here" document for the POM: {noformat} ... mvn --file /dev/stdin validate < 4.0.0 foo.bar.baz fooshizzle Dummy Project for Retrieving and Installing ${plugin_name} does-not-matter ${plugin_group_id} ${plugin_name} ${plugin_version_elem} EOF ... {noformat} It does this without creating any temporary files, which simplifies the program (there are no temporary file security bugs to worry about; there is no temporary directory to clean up when the program ends or when a signal is received, etc). More generally, though, not fixing the issue leaves an arbitrary limitation in the program, and violates the principle of least surprise (encountering an error when attempting to specify '{{/dev/stdin}}' as an argument to the '{{\-\-file}}' option is what lead me to investigate the issue in the first place). One of the strengths of unix command line tools is that they are of general use and expected to be used in combination with other tools, even in ways that their original authors did not foresee. There is no benefit of leaving this easily addressed issue in maven, only an arbitrary limitation. Some examples: {noformat} $ make -f /dev/stdin < all: > @echo "hello from stdin" > EOF hello from stdin $ ant -buildfile /dev/stdin < hello from stdin > EOF Buildfile: /dev/stdin [echo] hello from stdin BUILD SUCCESSFUL Total time: 0 seconds {noformat} And in case it gives anyone a warm and fuzzy, over the past year I've run maven 2.0.4, 2.0.5, and now 2.0.6 with the originally attached (simple) patch without any problems. > file size check on pom.xml (or thing specified by --file opt) should only > apply to regular files (patch attached) > - > > Key: MNG-2399 > URL: http://jira.codehaus.org/browse/MNG-2399 > Project: Maven 2 > Issue Type: Bug > Components: Command Line, General >Affects Versions: 2.0.4 >Reporter: Alan D. Salewski >Priority: Minor > Fix For: 2.0.x > > Attachments: MNG-2399-maven-core-2.0.4.patch, > MNG-2399-maven-core-trunk.patch, mvn-get-plugin > > > The file size check in {{maven-core/.../org/apache/maven/DefaultMaven.java}} > is applied too aggressively. In particular, it should only be applied to > regular files; when reading from a unix named pipe (probably other > platform-specific devices, too) we may not be able to determine the file size > prior to reading the data. > The real-world motiviation from this is the attached '{{mvn-get-plugin}}' > {{bash}} script, which wants to pipe a dummy {{pom.xml}} file to {{mvn}} on > {{stdin}} (by specifying {{/dev/stdin}} as the argument to the {{mvn}} > {{\-\-file}} command line option). > Once I submit this issue and have the issue number, I'll attach two patches, > one against the maven svn trunk, and one against the {{maven-2.0.4}} tag. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MNG-2399) file size check on pom.xml (or thing specified by --file opt) should only apply to regular files (patch attached)
[ http://jira.codehaus.org/browse/MNG-2399?page=all ] Alan D. Salewski updated MNG-2399: -- Attachment: MNG-2399-maven-core-2.0.4.patch MNG-2399-maven-core-trunk.patch > file size check on pom.xml (or thing specified by --file opt) should only > apply to regular files (patch attached) > - > > Key: MNG-2399 > URL: http://jira.codehaus.org/browse/MNG-2399 > Project: Maven 2 > Type: Bug > Components: General, Command Line > Versions: 2.0.4 > Reporter: Alan D. Salewski > Priority: Minor > Attachments: MNG-2399-maven-core-2.0.4.patch, > MNG-2399-maven-core-trunk.patch, mvn-get-plugin > > > The file size check in {{maven-core/.../org/apache/maven/DefaultMaven.java}} > is applied too aggressively. In particular, it should only be applied to > regular files; when reading from a unix named pipe (probably other > platform-specific devices, too) we may not be able to determine the file size > prior to reading the data. > The real-world motiviation from this is the attached '{{mvn-get-plugin}}' > {{bash}} script, which wants to pipe a dummy {{pom.xml}} file to {{mvn}} on > {{stdin}} (by specifying {{/dev/stdin}} as the argument to the {{mvn}} > {{\-\-file}} command line option). > Once I submit this issue and have the issue number, I'll attach two patches, > one against the maven svn trunk, and one against the {{maven-2.0.4}} tag. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Created: (MNG-2399) file size check on pom.xml (or thing specified by --file opt) should only apply to regular files (patch attached)
file size check on pom.xml (or thing specified by --file opt) should only apply to regular files (patch attached) - Key: MNG-2399 URL: http://jira.codehaus.org/browse/MNG-2399 Project: Maven 2 Type: Bug Components: General, Command Line Versions: 2.0.4 Reporter: Alan D. Salewski Priority: Minor Attachments: mvn-get-plugin The file size check in {{maven-core/.../org/apache/maven/DefaultMaven.java}} is applied too aggressively. In particular, it should only be applied to regular files; when reading from a unix named pipe (probably other platform-specific devices, too) we may not be able to determine the file size prior to reading the data. The real-world motiviation from this is the attached '{{mvn-get-plugin}}' {{bash}} script, which wants to pipe a dummy {{pom.xml}} file to {{mvn}} on {{stdin}} (by specifying {{/dev/stdin}} as the argument to the {{mvn}} {{\-\-file}} command line option). Once I submit this issue and have the issue number, I'll attach two patches, one against the maven svn trunk, and one against the {{maven-2.0.4}} tag. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira