Skip to content

Commit a249388

Browse files
authored
Merge pull request #288 from digipost/finalize-v3
Finalize v3
2 parents a3abf19 + 0e538a1 commit a249388

File tree

9 files changed

+270
-106
lines changed

9 files changed

+270
-106
lines changed

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This software includes third party software subject to the following licenses:
1010

1111
Digipost JAXB Resolver - com.sun.xml.bind under The Apache Software License, Version 2.0
1212
JavaBeans Activation Framework API jar under CDDL/GPLv2+CE
13+
JAXB Tools :: JAXB Basics :: Runtime under BSD-Style License
1314
jaxb-api under CDDL 1.1 or GPL2 w/ CPE
14-
JAXB2 Basics - Runtime under BSD-Style License
1515
Old JAXB Core under CDDL+GPL License
1616
Old JAXB Runtime under Eclipse Distribution License - v 1.0
1717
Posten signering - API JAXB Classes under The Apache Software License, Version 2.0

jaxb/NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This software includes third party software subject to the following licenses:
1010

1111
Digipost JAXB Resolver - com.sun.xml.bind under The Apache Software License, Version 2.0
1212
JavaBeans Activation Framework API jar under CDDL/GPLv2+CE
13+
JAXB Tools :: JAXB Basics :: Runtime under BSD-Style License
1314
jaxb-api under CDDL 1.1 or GPL2 w/ CPE
14-
JAXB2 Basics - Runtime under BSD-Style License
1515
Old JAXB Core under CDDL+GPL License
1616
Old JAXB Runtime under Eclipse Distribution License - v 1.0
1717
Posten signering - API JAXB Classes under The Apache Software License, Version 2.0

jaxb/pom.xml

Lines changed: 141 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@
3030
<artifactId>signature-api-specification-jaxb</artifactId>
3131

3232
<properties>
33-
<xsd.directory>${project.basedir}/target/generated-resources/xsd</xsd.directory>
33+
<xsd.directory>${project.build.directory}/generated-resources/xsd</xsd.directory>
34+
<xjc.build.directory>${project.build.directory}/generated-sources/xjc</xjc.build.directory>
3435
</properties>
3536

3637
<dependencyManagement>
3738
<dependencies>
3839
<dependency>
3940
<groupId>org.junit</groupId>
4041
<artifactId>junit-bom</artifactId>
41-
<version>5.9.2</version>
42+
<version>5.10.0</version>
4243
<type>pom</type>
4344
<scope>import</scope>
4445
</dependency>
@@ -63,9 +64,9 @@
6364
<scope>runtime</scope>
6465
</dependency>
6566
<dependency>
66-
<groupId>org.jvnet.jaxb2_commons</groupId>
67+
<groupId>org.jvnet.jaxb</groupId>
6768
<artifactId>jaxb2-basics-runtime</artifactId>
68-
<version>0.12.0</version>
69+
<version>2.0.9</version>
6970
</dependency>
7071
<dependency>
7172
<groupId>no.digipost.signature</groupId>
@@ -105,13 +106,13 @@
105106
<dependency>
106107
<groupId>nl.jqno.equalsverifier</groupId>
107108
<artifactId>equalsverifier</artifactId>
108-
<version>3.14</version>
109+
<version>3.15.1</version>
109110
<scope>test</scope>
110111
</dependency>
111112
<dependency>
112113
<groupId>org.javers</groupId>
113114
<artifactId>javers-core</artifactId>
114-
<version>6.9.1</version>
115+
<version>6.14.0</version>
115116
<scope>test</scope>
116117
</dependency>
117118
<dependency>
@@ -123,13 +124,13 @@
123124
<dependency>
124125
<groupId>org.slf4j</groupId>
125126
<artifactId>slf4j-api</artifactId>
126-
<version>2.0.6</version>
127+
<version>2.0.9</version>
127128
<scope>test</scope>
128129
</dependency>
129130
<dependency>
130131
<groupId>org.slf4j</groupId>
131132
<artifactId>slf4j-simple</artifactId>
132-
<version>2.0.6</version>
133+
<version>2.0.9</version>
133134
<scope>test</scope>
134135
</dependency>
135136
<dependency>
@@ -144,9 +145,51 @@
144145
<pluginManagement>
145146
<plugins>
146147
<plugin>
147-
<groupId>org.jvnet.jaxb2.maven2</groupId>
148-
<artifactId>maven-jaxb2-plugin</artifactId>
149-
<version>0.14.0</version>
148+
<groupId>org.jvnet.jaxb</groupId>
149+
<artifactId>jaxb-maven-plugin</artifactId>
150+
<version>2.0.9</version>
151+
<configuration>
152+
<specVersion>2.3</specVersion>
153+
<schemaDirectory>${xsd.directory}</schemaDirectory>
154+
<catalog>${xsd.directory}/catalog.xml</catalog>
155+
<strict>false</strict>
156+
<extension>true</extension>
157+
<bindingDirectory>${project.basedir}/src/main/jaxb</bindingDirectory>
158+
<args>
159+
<arg>-Xxew</arg>
160+
<arg>-Xxew:instantiate lazy</arg>
161+
<arg>-Xxew:control ${project.basedir}/src/main/jaxb/xew-control.properties</arg>
162+
<arg>-XtoString</arg>
163+
<arg>-XtoString-toStringStrategyClass=no.digipost.signature.jaxb.basics.LessFuzzToStringStrategy</arg>
164+
<arg>-Xjavadoc</arg>
165+
<arg>-Xvalue-constructor</arg>
166+
<arg>-Xfluent-api</arg>
167+
<arg>-Xinheritance</arg>
168+
<arg>-Xannotate</arg>
169+
</args>
170+
<plugins>
171+
<plugin>
172+
<groupId>org.jvnet.jaxb</groupId>
173+
<artifactId>jaxb2-basics</artifactId>
174+
<version>2.0.9</version>
175+
</plugin>
176+
<plugin>
177+
<groupId>org.jvnet.jaxb</groupId>
178+
<artifactId>jaxb-basics-annotate</artifactId>
179+
<version>2.0.9</version>
180+
</plugin>
181+
<plugin>
182+
<groupId>org.apache.cxf.xjcplugins</groupId>
183+
<artifactId>cxf-xjc-javadoc</artifactId>
184+
<version>3.3.2</version>
185+
</plugin>
186+
<plugin>
187+
<groupId>com.github.jaxb-xew-plugin</groupId>
188+
<artifactId>jaxb-xew-plugin</artifactId>
189+
<version>1.11</version>
190+
</plugin>
191+
</plugins>
192+
</configuration>
150193
</plugin>
151194
<plugin>
152195
<artifactId>maven-javadoc-plugin</artifactId>
@@ -176,79 +219,100 @@
176219
</executions>
177220
</plugin>
178221
<plugin>
179-
<groupId>org.jvnet.jaxb2.maven2</groupId>
180-
<artifactId>maven-jaxb2-plugin</artifactId>
222+
<groupId>org.jvnet.jaxb</groupId>
223+
<artifactId>jaxb-maven-plugin</artifactId>
181224
<executions>
182225
<execution>
226+
<id>xmldsig</id>
227+
<goals>
228+
<goal>generate</goal>
229+
</goals>
230+
<configuration>
231+
<bindingIncludes>bindings-xmldsig.xjb</bindingIncludes>
232+
<generateDirectory>${xjc.build.directory}/xmldsig</generateDirectory>
233+
<schemaIncludes>
234+
<include>thirdparty/xmldsig-core-schema.xsd</include>
235+
</schemaIncludes>
236+
</configuration>
237+
</execution>
238+
<execution>
239+
<id>xades</id>
183240
<goals>
184241
<goal>generate</goal>
185242
</goals>
243+
<configuration>
244+
<bindingIncludes>bindings-xades.xjb</bindingIncludes>
245+
<generateDirectory>${xjc.build.directory}/xades</generateDirectory>
246+
<schemaIncludes>
247+
<include>thirdparty/XAdES.xsd</include>
248+
</schemaIncludes>
249+
<args combine.children="append">
250+
<arg>-b</arg>
251+
<arg>${xjc.build.directory}/xmldsig/META-INF/sun-jaxb.episode</arg>
252+
</args>
253+
</configuration>
254+
</execution>
255+
<execution>
256+
<id>asice</id>
257+
<goals>
258+
<goal>generate</goal>
259+
</goals>
260+
<configuration>
261+
<bindingIncludes>bindings-ts_102918v010201.xjb</bindingIncludes>
262+
<generateDirectory>${xjc.build.directory}/asice</generateDirectory>
263+
<schemaIncludes>
264+
<include>thirdparty/ts_102918v010201.xsd</include>
265+
</schemaIncludes>
266+
<args combine.children="append">
267+
<arg>-b</arg>
268+
<arg>${xjc.build.directory}/xmldsig/META-INF/sun-jaxb.episode</arg>
269+
</args>
270+
</configuration>
271+
</execution>
272+
<execution>
273+
<id>sign</id>
274+
<goals>
275+
<goal>generate</goal>
276+
</goals>
277+
<configuration>
278+
<bindingIncludes>bindings-sign.xjb</bindingIncludes>
279+
<generateDirectory>${xjc.build.directory}/sign</generateDirectory>
280+
<schemaIncludes>
281+
<include>direct-and-portal.xsd</include>
282+
</schemaIncludes>
283+
<args combine.children="append">
284+
<arg>-b</arg>
285+
<arg>${xjc.build.directory}/asice/META-INF/sun-jaxb.episode</arg>
286+
<arg>-b</arg>
287+
<arg>${xjc.build.directory}/xades/META-INF/sun-jaxb.episode</arg>
288+
</args>
289+
</configuration>
290+
</execution>
291+
</executions>
292+
</plugin>
293+
<plugin>
294+
<artifactId>maven-antrun-plugin</artifactId>
295+
<executions>
296+
<execution>
297+
<phase>process-sources</phase>
298+
<goals>
299+
<goal>run</goal>
300+
</goals>
301+
<configuration>
302+
<target>
303+
<!-- This is a hack to remove excess ObjectFactory classes generated by xjc,
304+
even though the use of episodes are supposed to prevent that from happening.
305+
Seems like DigestValue, mapped to a Java byte[], is not included in the
306+
episode file generated from the compilation of xmldsig-core-schema, and are therefore
307+
regenerated in the compilation of xades.xsd and ts_102918v010201.xsd, resulting in a
308+
duplicate class error when compiling the generated Java code.
309+
See https://stackoverflow.com/a/32649545 -->
310+
<delete dir="${xjc.build.directory}/asice/no/digipost/signature/api/xml/thirdparty/xmldsig"/>
311+
<delete dir="${xjc.build.directory}/xades/no/digipost/signature/api/xml/thirdparty/xmldsig"/>
312+
</target>
313+
</configuration>
186314
</execution>
187315
</executions>
188-
<dependencies>
189-
<dependency>
190-
<groupId>org.glassfish.jaxb</groupId>
191-
<artifactId>jaxb-runtime</artifactId>
192-
<version>2.3.8</version>
193-
</dependency>
194-
</dependencies>
195-
<configuration>
196-
<specVersion>2.2</specVersion>
197-
<schemaDirectory>${xsd.directory}</schemaDirectory>
198-
<schemaIncludes>
199-
<include>direct-and-portal.xsd</include>
200-
<include>thirdparty/*.xsd</include>
201-
</schemaIncludes>
202-
<catalog>${xsd.directory}/catalog.xml</catalog>
203-
<strict>false</strict>
204-
<extension>true</extension>
205-
<removeOldOutput>true</removeOldOutput>
206-
<bindingDirectory>${project.basedir}/src/main/jaxb</bindingDirectory>
207-
<args>
208-
<arg>-Xxew</arg>
209-
<arg>-Xxew:instantiate lazy</arg>
210-
<arg>-Xxew:control ${project.basedir}/src/main/jaxb/xew-control.properties</arg>
211-
<arg>-XtoString</arg>
212-
<arg>-XtoString-toStringStrategyClass=no.digipost.signature.jaxb.basics.LessFuzzToStringStrategy</arg>
213-
<arg>-Xjavadoc</arg>
214-
<arg>-Xvalue-constructor</arg>
215-
<arg>-Xfluent-api</arg>
216-
<arg>-Xinheritance</arg>
217-
<arg>-Xannotate</arg>
218-
</args>
219-
<plugins>
220-
<plugin>
221-
<groupId>org.jvnet.jaxb2_commons</groupId>
222-
<artifactId>jaxb2-basics</artifactId>
223-
<version>0.12.0</version>
224-
</plugin>
225-
<plugin>
226-
<groupId>org.jvnet.jaxb2_commons</groupId>
227-
<artifactId>jaxb2-basics-annotate</artifactId>
228-
<version>1.1.0</version>
229-
</plugin>
230-
<plugin>
231-
<groupId>org.jvnet.jaxb2_commons</groupId>
232-
<artifactId>jaxb2-fluent-api</artifactId>
233-
<version>3.0</version>
234-
</plugin>
235-
<plugin>
236-
<groupId>org.jvnet.jaxb2_commons</groupId>
237-
<artifactId>jaxb2-value-constructor</artifactId>
238-
<version>3.0</version>
239-
</plugin>
240-
<plugin>
241-
<groupId>org.apache.cxf.xjcplugins</groupId>
242-
<artifactId>cxf-xjc-javadoc</artifactId>
243-
<version>3.3.1</version>
244-
</plugin>
245-
<plugin>
246-
<groupId>com.github.jaxb-xew-plugin</groupId>
247-
<artifactId>jaxb-xew-plugin</artifactId>
248-
<version>1.10</version>
249-
</plugin>
250-
</plugins>
251-
</configuration>
252316
</plugin>
253317

254318
</plugins>
Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,4 @@
134134
</bindings>
135135
</bindings>
136136

137-
<bindings schemaLocation="../../../target/generated-resources/xsd/thirdparty/ts_102918v010201.xsd" node="/xs:schema">
138-
<schemaBindings>
139-
<package name="no.digipost.signature.api.xml.thirdparty.asice" />
140-
</schemaBindings>
141-
</bindings>
142-
<bindings schemaLocation="../../../target/generated-resources/xsd/thirdparty/XAdES.xsd" node="/xs:schema">
143-
<schemaBindings>
144-
<package name="no.digipost.signature.api.xml.thirdparty.xades" />
145-
</schemaBindings>
146-
</bindings>
147-
<bindings schemaLocation="../../../target/generated-resources/xsd/thirdparty/xmldsig-core-schema.xsd" node="/xs:schema">
148-
<schemaBindings>
149-
<package name="no.digipost.signature.api.xml.thirdparty.xmldsig" />
150-
</schemaBindings>
151-
</bindings>
152-
153137
</bindings>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (C) Posten Norge AS
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<bindings version="2.1"
20+
xmlns="http://java.sun.com/xml/ns/jaxb"
21+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
24+
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb https://raw.githubusercontent.com/eclipse-ee4j/jaxb-api/2.3.2/bindingschema.xsd"
25+
extensionBindingPrefixes="xjc">
26+
27+
<globalBindings>
28+
<xjc:simple/>
29+
</globalBindings>
30+
31+
<bindings schemaLocation="../../../target/generated-resources/xsd/thirdparty/ts_102918v010201.xsd" node="/xs:schema">
32+
<schemaBindings>
33+
<package name="no.digipost.signature.api.xml.thirdparty.asice" />
34+
</schemaBindings>
35+
</bindings>
36+
37+
</bindings>

0 commit comments

Comments
 (0)