Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAVEN_JAXB2_PLUGIN-86] Plugin only generates the first listed execution when using multiple schemas configuration #8

Closed
highsource opened this issue Oct 3, 2014 · 7 comments

Comments

@highsource
Copy link
Owner

See https://java.net/jira/browse/MAVEN_JAXB2_PLUGIN-86.

highsource added a commit that referenced this issue Oct 3, 2014
highsource added a commit that referenced this issue Nov 10, 2014
highsource added a commit that referenced this issue Dec 10, 2014
highsource added a commit that referenced this issue Dec 10, 2014
@pnabbefeld
Copy link

pnabbefeld commented Sep 27, 2018

Seems it just doesn't iterate over executions - when I remove the first execution, the second works without cleaning before.
Further investigating, I found the following strange behaviour:

  1. When doing clean & build, only the first sub-package is created.
  2. When removing the first execution, the remaining packages are created when building.
  3. When renaming the package of the first execution, all are created.
    It seems there's some strange bug in the logic for testing which packages have to be built.

I've set "forceRegenerate" for all executions, that works for me.

phax referenced this issue in phax/maven-jaxb2-plugin Sep 1, 2022
…ph-commons-parent-pom-9.5.4

Bump ph-commons-parent-pom from 9.4.1 to 9.5.4
laurentschoelens pushed a commit to laurentschoelens/jaxb-tools that referenced this issue May 12, 2023
commit adapter config, and adapter java class
@laurentschoelens
Copy link
Collaborator

Seems it just doesn't iterate over executions - when I remove the first execution, the second works without cleaning before.
Further investigating, I found the following strange behaviour:

  1. When doing clean & build, only the first sub-package is created.
  2. When removing the first execution, the remaining packages are created when building.
  3. When renaming the package of the first execution, all are created.
    It seems there's some strange bug in the logic for testing which packages have to be built.

I've set "forceRegenerate" for all executions, that works for me.

@pnabbefeld could you share a sample ?
It seems that this issue is no longer a real issue for me with latest version...

@jhoeflaken
Copy link

jhoeflaken commented Apr 20, 2024

Hi,

I still cannot get this to work without foreceRegenerate. It seems that the plugin thinks for the seconds execution that everything is already up-to-date. See image below.

image

This is my configuration:

`<plugin>
     <groupId>org.jvnet.jaxb</groupId>
     <artifactId>jaxb-maven-plugin</artifactId>
     <version>4.0.6</version>
     <executions>
          <execution>
              <id>gnl</id>
              <goals>
                  <goal>generate</goal>
              </goals>
              <configuration>
                  <schemaDirectory>src/main/resources/schemas</schemaDirectory>
                  <schemaIncludes>
                      <include>MedMij_Gegevensdienstnamenlijst.1.11.xsd</include>
                  </schemaIncludes>
                  <generatePackage>nl.axians.zorg.dva.list.medmij.gnl</generatePackage>
               </configuration>
        </execution>
        <execution>
            <id>onl</id>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <schemaDirectory>src/main/resources/schemas</schemaDirectory>
                <schemaIncludes>
                    <include>MedMij_OAuthclientlist.5.14.xsd</include>
                </schemaIncludes>
                <generatePackage>nl.axians.zorg.dva.list.medmij.onl</generatePackage>
            </configuration>
        </execution>
    </executions>
</plugin>`

I have to XSD which I want to be generated in different packages. The XSD have some elements with the same name but different namespaces..

MedMij_OAuthclientlist.5.14.xsd.txt
MedMij_Gegevensdienstnamenlijst.1.11.txt

Kind regards,

Jacob

@laurentschoelens
Copy link
Collaborator

Hi @jhoeflaken

You should add the following <generateDirectory> to each of your configuration, with each having their own values.

Like <generateDirectory>${project.build.directory}/generated-sources/xjc-gnl</generateDirectory> for the first one and <generateDirectory>${project.build.directory}/generated-sources/xjc-onl</generateDirectory> for the second one.

@jhoeflaken
Copy link

Hi @laurentschoelens

Thnx. Works perfectly. Keep up the good work!

Kind regards,

Jacob

@laurentschoelens
Copy link
Collaborator

Hi @laurentschoelens

Thnx. Works perfectly. Keep up the good work!

Kind regards,

Jacob

You're welcome 😃

@laurentschoelens
Copy link
Collaborator

Closing issue since no example of non working case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants