-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
100 lines (74 loc) · 3.33 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
2010-05-09
Last modified: 2010-10-20
Introduction
------------
This project enhances the Maven Dependency Plugin
http://maven.apache.org/plugins/maven-dependency-plugin
by adding support for extracing dependency information
from a project's Spring XML files.
When enabled, a project's resources and test resources (usually located
in src/main/resources and src/test/resources) will be scanned for Spring XML files and all
bean definitions will be considered as project dependencies as well.
Requirements
------------
Java JDK 1.5+ (both for compiling AND RUNNING the plugin)
Maven 2.2.1+ (older versions will probably work as well)
Compiling and installing
------------------------
*UPDATE* : For ease of use I wrapped up a .tgz containing the patched maven-dependency-analyzer / maven-dependency-plugin
and maven-dependency-analyzer-spring artifacts. Just extract binaries/patched_plugins_repo.tgz into your
Maven repository folder (~/.m2/repository on Unix machines) and you should be good to go.
If you want to do the patching & compiling yourself (which I recommend since that way you can alter the pom files
and assign your own custom version numbers to the patched plugin/components to avoid mixups etc. ...
relying on SNAPSHOT versions is generally a bad idea).
To actually get the maven-dependency-plugin to support this extension:
1. Patch and mvn install maven-dependency-analyzer 1.1
svn co http://svn.apache.org/repos/asf/maven/shared/tags/maven-dependency-analyzer-1.1 maven-dependency-analyzer
cd maven-dependency-analyzer
patch -p0 -F3 <maven-dependency-analyzer_1.1.patch
mvn install
2. Patch and mvn install maven-dependency-plugin 2.1
svn co http://svn.apache.org/repos/asf/maven/plugins/tags/maven-dependency-plugin-2.1 maven-dependency-plugin
cd maven-dependency-plugin
patch -p0 <maven-dependency-plugin_2.1.patch
mvn install
3. Install maven-dependency-analyzer-spring
cd maven-dependency-analyzer-spring
mvn install
I'm trying to get the Maven guys to accept my patches
(see http://jira.codehaus.org/browse/MDEP-262) but
since I'm new to Maven plugin development the code will
most likely need some more work (if it gets accepted at all).
Usage
-----
The patched & installed maven-dependency-plugin currently has version 2.1-SNAPSHOT.
To enable scanning Spring XMLs for dependencies you need to add
this project's artifact as a dependency of the maven-dependency-plugin
*AND* set the plugin'S new 'analyzer' property to value 'spring'.
Declare the maven-dependency-plugin in your pom.xml using the following
XML snippet:
--->8---->8---
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>de.codesourcery.maven.shared</groupId>
<artifactId>maven-dependency-analyzer-spring</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<configuration>
<analyzer>spring</analyzer>
</configuration>
</plugin>
</plugins>
</build>
--->8---->8---
When running 'mvn dependency:analyze' on a project
with Spring XMLs , you should see the following output:
[INFO] Including dependencies from Spring XMLs in analysis
[INFO] Scanned Spring XML < ... Spring XML file ... >