mojohaus / jaxb2-maven-plugin

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

Add ability to use episode files from dependencies #234

Open onacit opened 1 year ago

onacit commented 1 year ago

Apologies for this question-like issue.

I have a module A for tns1 with generated episode file in it.

When some of module B's schemas <import/>s the tns1 and depends on the module A, I couldn't find the way to tell jaxb2-maven-plugin to use the episode file resides in the A artifact.

I tried with the following configuration and it didn't work.

<dependencies>
    <artifactId>A</artifactId>
</dependencies>

<build>
  <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <version>2.5.0</version>
        <executions>
          <execution>
            <id>xjc</id>
            <goals>
              <goal>xjc</goal>
            </goals>
            <phase>generate-sources</phase> <!-- default -->
            <configuration>
              <enableIntrospection>true</enableIntrospection>
              <episodeFileName>${automatic.module.name}-episode.xjb</episodeFileName>
              <xjbSources>
                <xjbSource>com.github.jinahya.org.w3.xmldsig.core1.bind-episode.xjb</xjbSource> <!-- resides in the A module -->
              </xjbSources>
            </configuration>
          </execution>
        </executions>
      </plugin>    
  </plugins>
</build>