Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-247

NullpointerException when createSourcesJar = true and source jar cannot be found

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Labels:
      None
    • Flags:
      Patch

      Description

      Configuration as follows:

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <configuration>
              <createSourcesJar>true</createSourcesJar>
          </configuration>
          <executions>
              <execution>
                  <phase>package</phase>
                  <goals>
                      <goal>shade</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      

      Dependency defined as follows:

      <dependency>
        <groupId>javax.jnlp</groupId>
        <artifactId>jnlp-api</artifactId>
        <version>1.7.0_06</version>
      </dependency>
      

      Sources for javax.jnlp for some reason disappeared from our maven repo proxy, which made maven-shade-plugin to output:

      [INFO] Including javax.jnlp:jnlp-api:jar:1.7.0_06 in the shaded jar.
      [WARNING] Could not get sources for javax.jnlp:jnlp-api:jar:1.7.0_06:compile
      

      and in turn:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.0.0:shade (default) on project xxxxx: Execution default of goal org.apache.maven.plugins:maven-shade-plugin:3.0.0:shade failed. NullPointerException -> [Help 1]
      

        Issue Links

          Activity

          Hide
          sodasmile Sodasmile added a comment -

          Patch to resolve nullpointer problem

          Show
          sodasmile Sodasmile added a comment - Patch to resolve nullpointer problem
          Hide
          elecharny Emmanuel Lecharny added a comment -

          Being hit by the exact same issue while trying to release Apache LDAP API project. Would be cool to have it fixed (and the patch is correct, AFAICT)...

          Show
          elecharny Emmanuel Lecharny added a comment - Being hit by the exact same issue while trying to release Apache LDAP API project. Would be cool to have it fixed (and the patch is correct, AFAICT)...
          Hide
          gboue Guillaume Boué added a comment -

          Fixed in r1797263.

          Show
          gboue Guillaume Boué added a comment - Fixed in r1797263 .
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-plugins #8980 (See https://builds.apache.org/job/maven-plugins/8980/)
          MSHADE-247 NullpointerException when createSourcesJar = true and source jar cannot be found
          Submitted by: Anders Smestad

          Applied after adding an IT. (gboue: http://svn.apache.org/viewvc/?view=rev&rev=1797263)

          • (add) maven-shade-plugin/src/it/MSHADE-247
          • (add) maven-shade-plugin/src/it/MSHADE-247/pom.xml
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-one
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1/mshade-247-one-0.1-sources.jar
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1/mshade-247-one-0.1.jar
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1/mshade-247-one-0.1.pom
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-two
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-two/0.1
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-two/0.1/mshade-247-two-0.1.jar
          • (add) maven-shade-plugin/src/it/MSHADE-247/repo/org/apache/maven/its/shade/csj/mshade-247-two/0.1/mshade-247-two-0.1.pom
          • (edit) maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-plugins #8980 (See https://builds.apache.org/job/maven-plugins/8980/ ) MSHADE-247 NullpointerException when createSourcesJar = true and source jar cannot be found Submitted by: Anders Smestad Applied after adding an IT. (gboue: http://svn.apache.org/viewvc/?view=rev&rev=1797263 ) (add) maven-shade-plugin/src/it/ MSHADE-247 (add) maven-shade-plugin/src/it/ MSHADE-247 /pom.xml (add) maven-shade-plugin/src/it/ MSHADE-247 /repo (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-one (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1 (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1/mshade-247-one-0.1-sources.jar (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1/mshade-247-one-0.1.jar (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-one/0.1/mshade-247-one-0.1.pom (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-two (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-two/0.1 (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-two/0.1/mshade-247-two-0.1.jar (add) maven-shade-plugin/src/it/ MSHADE-247 /repo/org/apache/maven/its/shade/csj/mshade-247-two/0.1/mshade-247-two-0.1.pom (edit) maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java

            People

            • Assignee:
              gboue Guillaume Boué
              Reporter:
              sodasmile Sodasmile
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development