This repository has been archived by the owner on Jul 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
make-pom.xsl
136 lines (130 loc) · 5.23 KB
/
make-pom.xsl
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
xmlns:xalan="http://xml.apache.org/xalan"
extension-element-prefixes="redirect"
version="1.0">
<xsl:output
method="xml"
indent="yes"
xalan:indent-amount="2"/>
<xsl:param name="VERSION" select="'6.3-SNAPSHOT'"/>
<xsl:template match="/">
<xsl:for-each select="components/component[@name!='all' and @name!='sandbox']">
<redirect:write select="concat('maven/', @name, '/pom.xml')">
<xsl:apply-templates select="."/>
</redirect:write>
</xsl:for-each>
</xsl:template>
<xsl:template match="component">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--
the parent is the same for all submodule
-->
<parent>
<artifactId>l2fprod-common-all</artifactId>
<groupId>com.l2fprod.common</groupId>
<version><xsl:value-of select="$VERSION"/></version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.l2fprod.common</groupId>
<artifactId>l2fprod-common-<xsl:value-of select="@name"/></artifactId>
<name><xsl:value-of select="@name"/></name>
<version><xsl:value-of select="$VERSION"/></version>
<description><xsl:value-of select="@name"/></description>
<build>
<sourceDirectory>target/filteredsrc</sourceDirectory>
<resources>
<resource>
<directory>../../src/java/<xsl:value-of select="@name"/></directory>
<includes>
<include>**/*.gif</include>
<include>**/*.jpg</include>
<include>**/*.png</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<filter token="VERSION">
<xsl:attribute name="value">${project.version}</xsl:attribute>
</filter>
<filter value="L2FProd.com Common Components" token="PROJECT.FULLNAME" />
<filter value="l2fprod-common" token="PROJECT.SHORTNAME" />
<filter value="2005-2006" token="YEAR" />
<mkdir>
<xsl:attribute name="dir">${basedir}/target/filteredsrc</xsl:attribute>
</mkdir>
<copy filtering="on">
<xsl:attribute name="todir">${basedir}/target/filteredsrc</xsl:attribute>
<fileset includes="**/*.java">
<xsl:attribute name="dir">../../src/java/${project.name}</xsl:attribute>
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<compress>true</compress>
<!--
<addMavenDescriptor>false</addMavenDescriptor>
-->
<manifest>
<mainClass><xsl:value-of select="@mainclass"/></mainClass>
<addExtensions>false</addExtensions>
<addClasspath>true</addClasspath>
</manifest>
<manifestSections>
<xsl:for-each select="bean">
<manifestSection>
<name><xsl:value-of select="@name"/></name>
<manifestEntries>
<Java-Bean>True</Java-Bean>
</manifestEntries>
</manifestSection>
</xsl:for-each>
</manifestSections>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<xsl:for-each select="depend">
<dependency>
<groupId>com.l2fprod.common</groupId>
<artifactId>l2fprod-common-<xsl:value-of select="."/></artifactId>
<version><xsl:value-of select="$VERSION"/></version>
<scope>compile</scope>
</dependency>
</xsl:for-each>
<xsl:for-each select="external-depend">
<dependency>
<groupId><xsl:value-of select="@groupId"/></groupId>
<artifactId><xsl:value-of select="@artifactId"/></artifactId>
<version><xsl:value-of select="@version"/></version>
<scope>compile</scope>
</dependency>
</xsl:for-each>
</dependencies>
</project>
</xsl:template>
</xsl:stylesheet>