From 48a0a1f97bc144bd4df85c9b66101a7bafb08d15 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:43:10 +0200 Subject: [PATCH 1/5] [#437] upgrade to jaxb-ri 2.3.9 (add test project for javadoc) --- jaxb-annotate-parent/tests/pom.xml | 1 + .../jvnet/jaxb/maven/AbstractXJC2Mojo.java | 8 +++-- maven-plugin/tests/javadoc/pom.xml | 30 +++++++++++++++++++ .../javadoc/src/main/resources/schema.xsd | 16 ++++++++++ .../src/test/resources/log4j.properties | 8 +++++ maven-plugin/tests/pom.xml | 1 + pom.xml | 2 +- 7 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 maven-plugin/tests/javadoc/pom.xml create mode 100644 maven-plugin/tests/javadoc/src/main/resources/schema.xsd create mode 100644 maven-plugin/tests/javadoc/src/test/resources/log4j.properties diff --git a/jaxb-annotate-parent/tests/pom.xml b/jaxb-annotate-parent/tests/pom.xml index 872cdb49f..950b85cde 100644 --- a/jaxb-annotate-parent/tests/pom.xml +++ b/jaxb-annotate-parent/tests/pom.xml @@ -45,6 +45,7 @@ annotations annox annotate + base-dependent issues one diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java index 2117cb54d..5d234ba5e 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java @@ -939,9 +939,13 @@ public void setEpisode(boolean episode) { * (via scd="x-schema::...") in the generated episode files. * This is necessary to avoid the annoying `SCD "x-schema::tns" didn't * match any schema component` errors. + * + * @deprecated since 2.0.10 - this is kept for retro-compatibility but will be removed since + * original bug has been resolved in 2.3.9 JAXB-RI */ - @Parameter(property = "maven.xjc2.addIfExistsToEpisodeSchemaBindings", defaultValue = "true") - private boolean addIfExistsToEpisodeSchemaBindings = true; + @Deprecated + @Parameter(property = "maven.xjc2.addIfExistsToEpisodeSchemaBindings", defaultValue = "false") + private boolean addIfExistsToEpisodeSchemaBindings = false; public boolean isAddIfExistsToEpisodeSchemaBindings() { return this.addIfExistsToEpisodeSchemaBindings; diff --git a/maven-plugin/tests/javadoc/pom.xml b/maven-plugin/tests/javadoc/pom.xml new file mode 100644 index 000000000..1aef20fa7 --- /dev/null +++ b/maven-plugin/tests/javadoc/pom.xml @@ -0,0 +1,30 @@ + + 4.0.0 + jaxb-maven-plugin-tests-javadoc + + org.jvnet.jaxb + jaxb-maven-plugin-tests + 2.0.10-SNAPSHOT + ../pom.xml + + jar + JAXB Tools :: Maven Plugin :: Test [javadoc] + + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.glassfish.jaxb + jaxb-runtime + + + + + + org.jvnet.jaxb + jaxb-maven-plugin + + + + diff --git a/maven-plugin/tests/javadoc/src/main/resources/schema.xsd b/maven-plugin/tests/javadoc/src/main/resources/schema.xsd new file mode 100644 index 000000000..3d101d928 --- /dev/null +++ b/maven-plugin/tests/javadoc/src/main/resources/schema.xsd @@ -0,0 +1,16 @@ + + + + + + My awesome complex type comment. + + + + + My awesome element comment. + + + + + diff --git a/maven-plugin/tests/javadoc/src/test/resources/log4j.properties b/maven-plugin/tests/javadoc/src/test/resources/log4j.properties new file mode 100644 index 000000000..19d0433be --- /dev/null +++ b/maven-plugin/tests/javadoc/src/test/resources/log4j.properties @@ -0,0 +1,8 @@ +log4j.rootCategory=DEBUG, stdout +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.target=system.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%m%n %c%n%n +log4j.logger.org.apache.commons.digester=INFO +log4j.logger.org.jvnet.hyperjaxb3=DEBUG +log4j.logger.org.hibernate=WARN diff --git a/maven-plugin/tests/pom.xml b/maven-plugin/tests/pom.xml index 290a24054..546d7ef65 100644 --- a/maven-plugin/tests/pom.xml +++ b/maven-plugin/tests/pom.xml @@ -31,6 +31,7 @@ catalog-xml episodes issues + javadoc p_o po-2.3 po-scd diff --git a/pom.xml b/pom.xml index 5c66b538c..4ced3b946 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 1.10.12 1.4.5 - 2.3.8 + 2.3.9 3.0.12 1.9.4 From b6f625ac64532ddfd855cdcb841c63f3796a8f16 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:08:04 +0200 Subject: [PATCH 2/5] [#438] get version of XJC at runtime and dump it on source generation --- .../jvnet/jaxb/maven/AbstractXJC2Mojo.java | 8 +++ .../org/jvnet/jaxb/maven/RawXJC2Mojo.java | 16 ++++- .../java/org/jvnet/jaxb/maven/XJCVersion.java | 61 +++++++++++++++++++ .../org/jvnet/jaxb/maven/RawXJC2MojoTest.java | 4 +- .../java/org/jvnet/jaxb/maven/XJC2Mojo.java | 11 +++- 5 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/XJCVersion.java diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java index 5d234ba5e..7d5e788e1 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java @@ -41,6 +41,14 @@ public abstract class AbstractXJC2Mojo extends AbstractMojo implements DependencyResourceResolver { + /** + * This method should be overriden in extending classes to get real value + * @return currently running XJC version + */ + public XJCVersion getVersion() { + return XJCVersion.UNDEFINED; + } + @Parameter(defaultValue = "${settings}", readonly = true) private Settings settings; diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java index de2dbe3bd..8ad1d3243 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java @@ -95,13 +95,23 @@ public abstract class RawXJC2Mojo extends AbstractXJC2Mojo { public static final String ADD_IF_EXISTS_TO_EPISODE_SCHEMA_BINDINGS_TRANSFORMATION_RESOURCE_NAME = "/" + RawXJC2Mojo.class.getPackage().getName().replace('.', '/') + "/addIfExistsToEpisodeSchemaBindings.xslt"; + private final XJCVersion version; + private Collection xjcPluginArtifacts; private Collection xjcPluginFiles; private List xjcPluginURLs; - public Collection getXjcPluginArtifacts() { + public RawXJCMojo(XJCVersion version) { + this.version = version; + } + + public XJCVersion getVersion() { + return version; + } + + public Collection getXjcPluginArtifacts() { return xjcPluginArtifacts; } @@ -469,9 +479,9 @@ protected void doExecute() throws MojoExecutionException { } else { final boolean isUpToDate = isUpToDate(); if (!isUpToDate) { - getLog().info("Sources are not up-to-date, XJC will be executed."); + getLog().info("Sources are not up-to-date, XJC (version " + getVersion().getRaw() + ") will be executed."); } else { - getLog().info("Sources are up-to-date, XJC will be skipped."); + getLog().info("Sources are up-to-date, XJC (version " + getVersion().getRaw() + ") will be skipped."); return; } } diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/XJCVersion.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/XJCVersion.java new file mode 100644 index 000000000..16199df63 --- /dev/null +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/XJCVersion.java @@ -0,0 +1,61 @@ +package org.jvnet.jaxb.maven; + +public class XJCVersion { + public static final XJCVersion UNDEFINED = new XJCVersion(null); + private String raw = "UNDEFINED"; + private int major; + private int minor; + private int bugfix; + + public XJCVersion(String version) { + if (version != null) { + this.raw = version; + int indexOfSnapshot = version.indexOf("-SNAPSHOT"); + if (indexOfSnapshot >= 0) { + version = version.substring(0, indexOfSnapshot); + } + String[] split = version.split("\\."); + if (split.length >= 3) { + major = Integer.valueOf(split[0]); + minor = Integer.valueOf(split[1]); + bugfix = Integer.valueOf(split[2]); + } + } + } + + public String getRaw() { + return raw; + } + + public int getMajor() { + return major; + } + + public int getMinor() { + return minor; + } + + public int getBugfix() { + return bugfix; + } + + public boolean isKnown() { + return !(this.major == 0 && this.minor == 0 && this.bugfix == 0); + } + + public boolean gte(int major, int minor, int bugfix) { + return this.major > major || (this.major == major && this.minor > minor) || (this.major == major && this.minor == minor && this.bugfix >= bugfix); + } + + public boolean gt(int major, int minor, int bugfix) { + return this.major > major || (this.major == major && this.minor > minor) || (this.major == major && this.minor == minor && this.bugfix > bugfix); + } + + public boolean lte(int major, int minor, int bugfix) { + return this.major < major || (this.major == major && this.minor < minor) || (this.major == major && this.minor == minor && this.bugfix <= bugfix); + } + + public boolean lt(int major, int minor, int bugfix) { + return this.major < major || (this.major == major && this.minor < minor) || (this.major == major && this.minor == minor && this.bugfix < bugfix); + } +} diff --git a/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java b/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java index 828ddda65..c20371b27 100644 --- a/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java +++ b/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java @@ -50,7 +50,7 @@ public void createJarFile() throws Exception { public void collectBindingUrisFromDependencies() throws Exception { List bindings = new ArrayList<>(); - final RawXJC2Mojo mojo = new RawXJC2Mojo() { + final RawXJCMojo mojo = new RawXJCMojo<>(XJCVersion.UNDEFINED) { @Override public MavenProject getProject() { @@ -106,7 +106,7 @@ public void doExecute(Void options) throws MojoExecutionException { public void collectsBindingUrisFromArtifact() throws Exception { List bindings = new ArrayList<>(); - final RawXJC2Mojo mojo = new RawXJC2Mojo() { + final RawXJCMojo mojo = new RawXJCMojo(XJCVersion.UNDEFINED) { @Override protected IOptionsFactory getOptionsFactory() { diff --git a/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java b/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java index 1464bab4a..8bbe2a8fe 100644 --- a/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java +++ b/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java @@ -5,6 +5,7 @@ import java.text.MessageFormat; import java.util.Iterator; +import com.sun.tools.xjc.Messages; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; @@ -29,7 +30,15 @@ public class XJC2Mojo extends RawXJC2Mojo { private final IOptionsFactory optionsFactory = new OptionsFactory(); - @Override + public XJCMojo() { + super(parseXJCVersion()); + } + + private static XJCVersion parseXJCVersion() { + return new XJCVersion(Messages.format("Driver.BuildID")); + } + + @Override protected IOptionsFactory getOptionsFactory() { return optionsFactory; } From a212bda5648ac31523391fa3d17a2cb2e7be67d8 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Wed, 18 Oct 2023 23:25:09 +0200 Subject: [PATCH 3/5] [#338] enable reresolution work around based on jaxb-ri used --- .../jvnet/jaxb/maven/AbstractXJC2Mojo.java | 5 ++- .../org/jvnet/jaxb/maven/RawXJC2Mojo.java | 2 +- .../ReResolvingEntityResolverWrapper.java | 33 +++++++++++++++---- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java index 7d5e788e1..4ed14588f 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/AbstractXJC2Mojo.java @@ -443,8 +443,11 @@ public void setCatalogResolver(String catalogResolver) { /** * If 'true', the fix for issue #306 will no more be applied. + * + * @deprecated (forRemoval = true, since = "2.0.10") */ - @Parameter(defaultValue = "false", property = "maven.xjc2.disableSystemIdResolution") + @Parameter(defaultValue = "true", property = "maven.xjc2.disableSystemIdResolution") + @Deprecated private boolean disableSystemIdResolution; public boolean getDisableSystemIdResolution() { diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java index 8ad1d3243..c87957228 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java @@ -903,7 +903,7 @@ private void setupEntityResolver() { } protected EntityResolver createEntityResolver(CatalogResolver catalogResolver) { - final EntityResolver entityResolver = new ReResolvingEntityResolverWrapper(catalogResolver, getLog(), getDisableSystemIdResolution()); + final EntityResolver entityResolver = new ReResolvingEntityResolverWrapper(catalogResolver, getLog(), getDisableSystemIdResolution(), getVersion()); return entityResolver; } diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/resolver/tools/ReResolvingEntityResolverWrapper.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/resolver/tools/ReResolvingEntityResolverWrapper.java index c868779c6..64a304056 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/resolver/tools/ReResolvingEntityResolverWrapper.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/resolver/tools/ReResolvingEntityResolverWrapper.java @@ -5,6 +5,7 @@ import java.util.Optional; import org.apache.maven.plugin.logging.Log; +import org.jvnet.jaxb.maven.XJCVersion; import org.jvnet.jaxb.maven.plugin.logging.NullLog; import org.jvnet.jaxb.maven.util.StringUtils; import org.xml.sax.EntityResolver; @@ -17,21 +18,41 @@ public class ReResolvingEntityResolverWrapper implements EntityResolver { private final Log log; private final boolean disableSystemIdResolution; - public ReResolvingEntityResolverWrapper(EntityResolver entityResolver, Log log, boolean disableSystemIdResolution) { + public ReResolvingEntityResolverWrapper(EntityResolver entityResolver, Log log, boolean disableSystemIdResolution, XJCVersion version) { if (entityResolver == null) { throw new IllegalArgumentException("Provided entity resolver must not be null."); } this.entityResolver = entityResolver; this.log = Optional.ofNullable(log).orElse(NullLog.INSTANCE); - this.disableSystemIdResolution = disableSystemIdResolution; - if (disableSystemIdResolution) { - log.warn("ReResolvingEntityResolverWrapper : systemIdResolution fix is disable, you may have problems with schema resolution."); + this.disableSystemIdResolution = computeDisableSystemIdResolution(disableSystemIdResolution, version); + } + + private boolean computeDisableSystemIdResolution(boolean disableSystemIdResolution, XJCVersion version) { + boolean finalDisableSystemIdResolution = disableSystemIdResolution; + boolean versionCheck = false; + if (version.isKnown()) { + versionCheck = true; + if (version.gte(2, 3, 9) && !disableSystemIdResolution) { + log.info("ReResolvingEntityResolverWrapper : systemIdResolution fix has been auto-disabled (current running XJC is " + version.getRaw() + ")."); + finalDisableSystemIdResolution = true; + } else if (version.gte(2, 3, 4) && version.lt(2, 3, 9) && disableSystemIdResolution) { + log.info("ReResolvingEntityResolverWrapper : systemIdResolution fix has been auto-enabled (current running XJC is " + version.getRaw() + ")."); + finalDisableSystemIdResolution = false; + } + } + if (finalDisableSystemIdResolution) { + if (!versionCheck) { + log.warn("ReResolvingEntityResolverWrapper : systemIdResolution fix is disable, you may have problems with schema resolution."); + } else { + log.debug("ReResolvingEntityResolverWrapper : systemIdResolution fix is disabled"); + } } else { log.debug("ReResolvingEntityResolverWrapper : systemIdResolution fix is enabled"); } - } + return finalDisableSystemIdResolution; + } - @Override + @Override public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { log.debug(MessageFormat.format("ReResolvingEntityResolverWrapper : Resolving publicId [{0}], systemId [{1}].", publicId, systemId)); From 41e4cdbff45e55fc2d7e43ceb6b0f647ca184350 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:30:07 +0100 Subject: [PATCH 4/5] add base-dependent project missing files + comment and fix build errors --- .../tests/base-dependent/pom.xml | 120 ++++++++++++++++++ .../src/main/resources/xsd/base.xsd | 26 ++++ .../src/main/resources/xsd/dependent.xsd | 31 +++++ jaxb-annotate-parent/tests/pom.xml | 2 +- .../org/jvnet/jaxb/maven/RawXJC2Mojo.java | 2 +- .../org/jvnet/jaxb/maven/RawXJC2MojoTest.java | 4 +- .../java/org/jvnet/jaxb/maven/XJC2Mojo.java | 2 +- 7 files changed, 182 insertions(+), 5 deletions(-) create mode 100644 jaxb-annotate-parent/tests/base-dependent/pom.xml create mode 100644 jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/base.xsd create mode 100644 jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/dependent.xsd diff --git a/jaxb-annotate-parent/tests/base-dependent/pom.xml b/jaxb-annotate-parent/tests/base-dependent/pom.xml new file mode 100644 index 000000000..d5ed99934 --- /dev/null +++ b/jaxb-annotate-parent/tests/base-dependent/pom.xml @@ -0,0 +1,120 @@ + + 4.0.0 + + org.jvnet.jaxb + jaxb-annotate-plugin-tests + 2.0.10-SNAPSHOT + + jaxb-annotate-plugin-test-base-dependent + jar + JAXB Tools :: Annotate :: Test [base-dependent] + + + org.glassfish.jaxb + jaxb-runtime + + + org.glassfish.jaxb + jaxb-xjc + + + org.jvnet.jaxb + jaxb-maven-plugin-testing + test + + + org.jvnet.jaxb + jaxb-basics-annotate + + + javax.validation + validation-api + 2.0.1.Final + + + + test + + + org.jvnet.jaxb + jaxb-maven-plugin + + + base + + generate + + + false + ${basedir}/src/main/resources/xsd + + base.xsd + + org.test.base + UTF-8 + true + true + ${basedir}/target/generated-sources/xjc/META-INF/base.xjb + + -Xannotate + + + + javax.validation + validation-api + + + org.jvnet.jaxb + jaxb-basics-annotate + + + + + + + dependent + + generate + + + ${basedir}/src/main/resources/xsd + + dependent.xsd + + org.test.dependent + UTF-8 + + + + ${basedir}/target/generated-sources/xjc/META-INF + + *.xjb + + + + + true + true + ${basedir}/target/generated-sources/xjc/META-INF/dependent.xjb + + -Xannotate + + + + javax.validation + validation-api + + + org.jvnet.jaxb + jaxb-basics-annotate + + + + + + + + + diff --git a/jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/base.xsd b/jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/base.xsd new file mode 100644 index 000000000..26293abf0 --- /dev/null +++ b/jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/base.xsd @@ -0,0 +1,26 @@ + + + + + + + + + @javax.validation.constraints.NotNull + + + + + + + diff --git a/jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/dependent.xsd b/jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/dependent.xsd new file mode 100644 index 000000000..6f9b86069 --- /dev/null +++ b/jaxb-annotate-parent/tests/base-dependent/src/main/resources/xsd/dependent.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + @javax.validation.constraints.NotNull + + + + + + + diff --git a/jaxb-annotate-parent/tests/pom.xml b/jaxb-annotate-parent/tests/pom.xml index 950b85cde..6c1e0dbbd 100644 --- a/jaxb-annotate-parent/tests/pom.xml +++ b/jaxb-annotate-parent/tests/pom.xml @@ -45,7 +45,7 @@ annotations annox annotate - base-dependent + issues one diff --git a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java index c87957228..4d1c965e8 100644 --- a/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java +++ b/maven-plugin/plugin-core/src/main/java/org/jvnet/jaxb/maven/RawXJC2Mojo.java @@ -103,7 +103,7 @@ public abstract class RawXJC2Mojo extends AbstractXJC2Mojo { private List xjcPluginURLs; - public RawXJCMojo(XJCVersion version) { + public RawXJC2Mojo(XJCVersion version) { this.version = version; } diff --git a/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java b/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java index c20371b27..b23d2c385 100644 --- a/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java +++ b/maven-plugin/plugin-core/src/test/java/org/jvnet/jaxb/maven/RawXJC2MojoTest.java @@ -50,7 +50,7 @@ public void createJarFile() throws Exception { public void collectBindingUrisFromDependencies() throws Exception { List bindings = new ArrayList<>(); - final RawXJCMojo mojo = new RawXJCMojo<>(XJCVersion.UNDEFINED) { + final RawXJC2Mojo mojo = new RawXJC2Mojo(XJCVersion.UNDEFINED) { @Override public MavenProject getProject() { @@ -106,7 +106,7 @@ public void doExecute(Void options) throws MojoExecutionException { public void collectsBindingUrisFromArtifact() throws Exception { List bindings = new ArrayList<>(); - final RawXJCMojo mojo = new RawXJCMojo(XJCVersion.UNDEFINED) { + final RawXJC2Mojo mojo = new RawXJC2Mojo(XJCVersion.UNDEFINED) { @Override protected IOptionsFactory getOptionsFactory() { diff --git a/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java b/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java index 8bbe2a8fe..22df92e45 100644 --- a/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java +++ b/maven-plugin/plugin/src/main/java/org/jvnet/jaxb/maven/XJC2Mojo.java @@ -30,7 +30,7 @@ public class XJC2Mojo extends RawXJC2Mojo { private final IOptionsFactory optionsFactory = new OptionsFactory(); - public XJCMojo() { + public XJC2Mojo() { super(parseXJCVersion()); } From f574786bcd7cc88d0f91d0b477ac78f79045a2c5 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:01:18 +0100 Subject: [PATCH 5/5] fix missing ${project.version} in hyperjaxb sample --- hyperjaxb/ejb/samples/po-customized-toplink/project-pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hyperjaxb/ejb/samples/po-customized-toplink/project-pom.xml b/hyperjaxb/ejb/samples/po-customized-toplink/project-pom.xml index af59a2da0..4ae263264 100644 --- a/hyperjaxb/ejb/samples/po-customized-toplink/project-pom.xml +++ b/hyperjaxb/ejb/samples/po-customized-toplink/project-pom.xml @@ -1,5 +1,5 @@ - 4.0.0 org.jvnet.jaxb @@ -59,6 +59,7 @@ org.jvnet.jaxb hyperjaxb3-maven-plugin + ${project.version}