Created
September 29, 2014 14:09
-
-
Save stoerr/0406282aedbb8c7a6a52 to your computer and use it in GitHub Desktop.
Prints dependencies of a multi module maven project as graph in dotty / graphviz format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pom="http://maven.apache.org/POM/4.0.0"> | |
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/> | |
<!-- | |
Generiert Fragment von dotty-File für die Pom-Abhängigkeiten. | |
Anwendung: | |
( | |
echo "digraph PomDependencies {" | |
find . -name pom.xml | xargs xsltproc pom2dotty.xslt | sort -u | |
echo "}" | |
) | tred > poms.dotty | |
Danach Filterung Plot mit GvEdit | |
--> | |
<xsl:template match="/"> | |
<xsl:for-each select="/pom:project/pom:dependencies/pom:dependency"> | |
<xsl:if test="pom:groupId = 'net.stoerr'"> | |
<xsl:choose> | |
<xsl:when test="pom:scope = 'compile'"> | |
"<xsl:value-of select="/pom:project/pom:artifactId"/>" -> "<xsl:value-of select="pom:artifactId"/>" ;<xsl:text> | |
</xsl:text> | |
</xsl:when> | |
<xsl:when test="pom:scope"> | |
</xsl:when> | |
<xsl:otherwise> | |
"<xsl:value-of select="/pom:project/pom:artifactId"/>" -> "<xsl:value-of select="pom:artifactId"/>" ;<xsl:text> | |
</xsl:text> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment