Mareleze / jarjar

Automatically exported from code.google.com/p/jarjar
0 stars 0 forks source link

Add a new Mojo in the maven plugin to support the find dependency feature #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The attached patch extends the jarjar maven plugin to support the find 
dependency feature of jarjar plugin. This could be exploited to easily mavenize 
projects from jar by dynamically creating poms with proper dependencies.

Here is how to use this feature:

<build>
  <plugins>
...
      <plugin>
        <groupId>com.tonicsystems.jarjar</groupId>
        <artifactId>jarjar-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>find</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <level>JAR</level>
          <libs>${project.build.directory}/yourLibraryPath/*</libs>
          <deps>${project.build.directory}/yourLibraryPath/*:${project.build.directory}/yourDepsPath/*</deps>
          <report>${project.build.directory}/depfind/dependency.txt</report>
        </configuration>
      </plugin>
...
  </plugins>
</build>

<level> could be either JAR or CLASS (uppercase is mandatory) and is mandatory.
<libs> is the classpath of the classes to be analysed and is mandatory.
<deps> is the classpath of dependancies to be considered, if missing <libs> is 
used
<report> is a file where the result of the analysis is written, if missing 
stdout is used

There is some potential improvement that I am thinking about:
 - Use multivalued argument for the classpath
 - extends this feature further to directly generating poms

WDYT ?

Original issue reported on code.google.com by denis.ge...@eguilde.eu on 16 Jun 2010 at 7:58

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
There is an issue in ASM 3.1 regarding the remapper and Java5 Annotation. You 
should rebuild JarJar with ASM 3.3 to ensure proper dependency analysis of 
Annotations.

Original comment by denis.ge...@eguilde.eu on 25 Jun 2010 at 2:58