-
Notifications
You must be signed in to change notification settings - Fork 143
/
pom.xml
executable file
·206 lines (187 loc) · 8.73 KB
/
pom.xml
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.glassfish.main.appclient</groupId>
<artifactId>client</artifactId>
<version>7.0.4-SNAPSHOT</version>
</parent>
<artifactId>acc-config</artifactId>
<packaging>glassfish-jar</packaging>
<name>ACC Config Classes (JAXB)</name>
<developers>
<developer>
<id>tjquinn</id>
<name>Tim Quinn</name>
<url>http://blogs.sun.com/quinn</url>
<organization>Oracle, Inc.</organization>
<roles>
<role>lead</role>
<role>developer</role>
</roles>
</developer>
</developers>
<!--
This module contains classes for the app client configuration XML,
generated using JAXB from sun-application-client-container_x_y.dtd.
-->
<properties>
<extracted-dtd-root>target/extracted</extracted-dtd-root>
<extracted-dtd-top-level-directory>${extracted-dtd-root}/glassfish</extracted-dtd-top-level-directory>
<extracted-dtd-directory>${extracted-dtd-top-level-directory}/lib/dtds</extracted-dtd-directory>
<dtd-for-jaxb-compilation>glassfish-application-client-container_1_3.dtd</dtd-for-jaxb-compilation>
<config-dtd-file>*-application-client-container*.dtd</config-dtd-file>
<added-test-classpath>${project.basedir}/${extracted-dtd-root}</added-test-classpath>
<findbugs.exclude>${project.basedir}/exclude.xml</findbugs.exclude>
</properties>
<dependencies>
<!--
We depend on the deployment/dtds module which contains the sun-application-client-container_1_2.dtd
and glassfish-application-client-container_1_3.dtd.
We use that for generating JAXB classes but we do not want to package the DTD with the ACC module, nor
do we want the ACC module depending on the deploymenet/dtds module at runtime.
Note the scope is "provided" to indicate this.
-->
<dependency>
<groupId>org.glassfish.main.deployment</groupId>
<artifactId>appserver-dtds</artifactId>
<version>${project.version}</version>
<type>zip</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-osgi</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<!-- Extracts the DTD(s) from the deployment/dtds module into
a temp file. The "generate" phase will use it to create JAXB classes. Unit
tests use both DTDs for parse testing. -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-dtd</id>
<phase>initialize</phase> <!-- make sure this is before generate -->
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.glassfish.main.deployment</groupId>
<artifactId>appserver-dtds</artifactId>
<version>${project.version}</version>
<type>zip</type>
<includes>**/${config-dtd-file}</includes>
<overWrite>true</overWrite>
<outputDirectory>${extracted-dtd-root}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Generates JAXB classes based on the ACC configuration file
DTD. -->
<!--
XXX: no maven plugin for jakarta xml binding impl exists,
so we have to stick with Ant
and attach source root to the build ourselves...
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>${jakarta.jaxb-impl.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>xjc-gen-for-glassfish-acc</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="maven.plugin.classpath"/>
<property name="dest" location="${project.build.directory}/generated-sources/xjc"/>
<mkdir dir="${dest}"/>
<xjc destdir="${dest}" fork="true"
schema="${project.basedir}/${extracted-dtd-directory}/${dtd-for-jaxb-compilation}"
package="org.glassfish.appclient.client.acc.config">
<binding dir="${project.basedir}/src/main/resources" includes="configBindings.xml"/>
<arg value="-dtd"/>
<jvmarg value="-DenableExternalEntityProcessing=true"/>
</xjc>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/xjc</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<additionalClasspathElements>
<additionalClasspathElement>${added-test-classpath}</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
</plugins>
</build>
</project>