leotalero / addjars-maven-plugin

Automatically exported from code.google.com/p/addjars-maven-plugin
Apache License 2.0
0 stars 0 forks source link

Resource vs. JarResource #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Possible documentation error.  Documentation states to use  "Resource". That 
resulted in "Error loading class ' com.googlecode.addjars.mojo.Resource'" 
exception though. Changed "Resource" to "JarResource", and that seemed to work 
(although running in to NullPointerException now).

{{{
      <plugin>
          <groupId>com.googlecode.addjars-maven-plugin</groupId>
          <artifactId>addjars-maven-plugin</artifactId>
          <version>1.0.2</version>
          <executions>
              <execution>
                  <goals>
                      <goal>add-jars</goal>
                  </goals>
                  <configuration>
                      <resources>
                          <JarResource> <!-- HERE -->
                              <directory>${basedir}/lib</directory>
                          </JarResource>
                      </resources>
                  </configuration>
              </execution>
          </executions>
      </plugin> 
}}}

Original issue reported on code.google.com by j...@jgstechnical.com on 7 Mar 2012 at 5:13

GoogleCodeExporter commented 9 years ago
Quick follow-up on the NullPointerException originating in this plugin:  It 
went away when I upgraded from Maven 3.0.2 to 3.0.4.

Original comment by j...@jgstechnical.com on 7 Mar 2012 at 5:31

GoogleCodeExporter commented 9 years ago
My apologies for the late response (I thought the system would notify me of new 
issues as they come, but it apparently hasn't).

As for your suggestion to replace <resource> with <JarResource>... In my case 
it works with *any* xml tag, like this:

                      <resources>
                          <test> <!-- HERE -->
                              <directory>${basedir}/lib</directory>
                          </test>
                      </resources>

Maybe it was an issue of the old maven version (3.0.2)?
Could you possibly check whether your build works with <resource> tag now (with 
maven 3.0.4)?

Thank you for the report anyway.

Original comment by v.kary...@gmail.com on 14 Mar 2012 at 7:00

GoogleCodeExporter commented 9 years ago
I can no longer test if that was also a 3.0.2 vs. 3.0.4 issue.   After 
switching to 3.0.4, I then found that this plugin was affecting the basedir 
path for other plugins in the POM.  This plugin's approach sounds like a good 
idea, but I didn't have time to keep debugging issues and so I reverted to a 
project relative file based repo.

Original comment by j...@jgstechnical.com on 15 Mar 2012 at 2:13

GoogleCodeExporter commented 9 years ago
I have made sure that the issue is reproducible in old maven versions only 
(3.0.2 and below), and it was fixed in Maven version 3.0.3. Refer to 
http://jira.codehaus.org/browse/MNG-4551 for details.
As a solution, I have updated the Prerequisites section of the documentation.

As for the "affecting the basedir path" issue... Not sure what you mean, but I 
will gladly investigate the issue if you find time someday and report it :)

Original comment by v.kary...@gmail.com on 16 Mar 2012 at 5:27