mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
105 stars 76 forks source link

testXjc MOJO - generated test sources are added to sources jar artifact too #134

Closed petrprochy closed 3 months ago

petrprochy commented 5 years ago

When is generated test JAXB sources from XSD schema and sources JAR artifact is created too (ex. with -DperformRelease=true), then this generated sources are added to JAR.

I created IT test with this goals: clean test-compile source:jar source:test-jar and output is:

[INFO] --- maven-source-plugin:3.1.0:jar (default-cli) @ xjc-test-sources --- [DEBUG] Configuring mojo org.apache.maven.plugins:maven-source-plugin:3.1.0:jar from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-source-plugin:3.1.0, parent: sun.misc.Launcher$AppClassLoader@4e25154f] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-source-plugin:3.1.0:jar' with basic configurator --> [DEBUG] (f) attach = true [DEBUG] (f) classifier = sources [DEBUG] (f) defaultManifestFile = D:\usr\projects\maven\jaxb2-maven-plugin\target\it\xjc-test-resources\target\classes\META-INF\MANIFEST.MF [DEBUG] (f) excludeResources = false [DEBUG] (f) finalName = xjc-test-sources-1.0-SNAPSHOT [DEBUG] (f) forceCreation = false [DEBUG] (f) includePom = false [DEBUG] (f) outputDirectory = D:\usr\projects\maven\jaxb2-maven-plugin\target\it\xjc-test-resources\target [DEBUG] (f) project = MavenProject: org.codehaus.mojo.jaxb2.its:xjc-test-sources:1.0-SNAPSHOT @ D:\usr\projects\maven\jaxb2-maven-plugin\target\it\xjc-test-resources\pom.xml [DEBUG] (f) reactorProjects = [MavenProject: org.codehaus.mojo.jaxb2.its:xjc-test-sources:1.0-SNAPSHOT @ D:\usr\projects\maven\jaxb2-maven-plugin\target\it\xjc-test-resources\pom.xml] [DEBUG] (f) session = org.apache.maven.execution.MavenSession@21362712 [DEBUG] (f) skipSource = false [DEBUG] (f) useDefaultExcludes = true [DEBUG] (f) useDefaultManifestFile = false [DEBUG] -- end configuration -- [DEBUG] isUp2date: false (Destination D:\usr\projects\maven\jaxb2-maven-plugin\target\it\xjc-test-resources\target\xjc-test-sources-1.0-SNAPSHOT-sources.jar not found.) [INFO] Building jar: D:\usr\projects\maven\jaxb2-maven-plugin\target\it\xjc-test-resources\target\xjc-test-sources-1.0-SNAPSHOT-sources.jar [DEBUG] adding directory META-INF/ [DEBUG] adding entry META-INF/MANIFEST.MF [DEBUG] adding entry Main.java [DEBUG] adding directory com/ [DEBUG] adding directory com/example/ [DEBUG] adding directory com/example/myschema/ [DEBUG] adding directory META-INF/JAXB/ [DEBUG] adding entry com/example/myschema/AddressType.java [DEBUG] adding entry com/example/myschema/ObjectFactory.java [DEBUG] adding entry META-INF/JAXB/episode_xjc-test.xjb [DEBUG] adding directory META-INF/maven/ [DEBUG] adding directory META-INF/maven/org.codehaus.mojo.jaxb2.its/ [DEBUG] adding directory META-INF/maven/org.codehaus.mojo.jaxb2.its/xjc-test-sources/ [DEBUG] adding entry META-INF/maven/org.codehaus.mojo.jaxb2.its/xjc-test-sources/pom.xml [DEBUG] adding entry META-INF/maven/org.codehaus.mojo.jaxb2.its/xjc-test-sources/pom.properties

build.log

mkuzela commented 3 years ago

I have same issue, looks like bug was introduced in version 2.3 (2.2 is fine in my case)

marschall commented 2 years ago

@mkuzela it looks like the bug was introduced with f460f4acc31f9fb5ec85ffa6a33ecdbeace6f400