A Maven ProjectDependencyAnalyzer that includes dependencies introduced by bean definitions from a project's Spring XML files
License: Apache License 2.0
Java 97.69%Diff 2.31%
maven-dependency-analyzer-spring's Introduction
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. It is a fork of
https://github.com/toby1984/maven-dependency-analyzer-spring
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.
Differences with the fork
--------------------------
* Update the dependencies to maven-dependency-analyzer
* Improve the logic for detecting Spring XML files
* Reduce the changes in the superclass DefaultProjectDependencyAnalyzer
Requirements
------------
Java JDK 1.5+ (both for compiling AND RUNNING the plugin)
Maven 2.2.1+ (older versions will probably work as well)
Maven Dependency Plugin 2.10+
Compiling and installing
------------------------
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.6 maven-dependency-analyzer
cd maven-dependency-analyzer
patch -p0 -F3 < apache-maven-dependency-analyzer-1.6.patch
mvn install
2. Install maven-dependency-analyzer-spring
cd maven-dependency-analyzer-spring
mvn install
I open a ticket (see http://jira.codehaus.org/browse/MSHARED-412) for this change.
Usage
-----
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 '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.10</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 ... >