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

Update Project... in Eclipse does not work as expected #502

Closed
alerosmile opened this issue Feb 14, 2024 · 7 comments
Closed

Update Project... in Eclipse does not work as expected #502

alerosmile opened this issue Feb 14, 2024 · 7 comments
Assignees
Labels
bug maven-plugin Issue concerns maven plugin
Milestone

Comments

@alerosmile
Copy link

m2e has 2 lifecycle mappings: onConfiguration and onIncremental.

Maven -> Update Project... in Eclipse runs onConfiguration and then onIncremental. During onConfiguration, the provided BuildContext is the EclipseEmptyBuildContext. During this step, no binding files nor catalog files are read or resolved.

RawXJC2Mojo.isUpToDate() returns false because URLs are not resolved due to the missing catalog. Therefore XJC2Mojo.doExecute(Options) is executed, but no files are written during XJC2Mojo.writeCode(Outline). This is ok. But the (empty) episode file is written although it shouldn't.

In the next step (onIncremental), RawXJC2Mojo.isUpToDate() returns true because the episode file is up-to-date and no java files are generated!

As a workaround, I can set <episode>false</episode>. But the plugin should suppress the creation of the episode file if the BuildContext is the EclipseEmptyBuildContext.

@laurentschoelens
Copy link
Collaborator

Hi @alerosmile

Could you provide MRE please so we can investigate ?

Thanks

@laurentschoelens laurentschoelens added question maven-plugin Issue concerns maven plugin labels Feb 14, 2024
@alerosmile
Copy link
Author

Hi @laurentschoelens

https://github.com/alerosmile/example-jaxb-maven-plugin-episode

Delete the target directory and then run Update Project... inside Eclipse. The episode file is created, the Java files not.

@laurentschoelens
Copy link
Collaborator

Thanks, I'll look for it

@laurentschoelens
Copy link
Collaborator

@alerosmile tested against 2.0.10-SNAPSHOT PR #503 -> build is OK now

laurentschoelens added a commit to laurentschoelens/jaxb-tools that referenced this issue Feb 15, 2024
laurentschoelens added a commit to laurentschoelens/jaxb-tools that referenced this issue Feb 15, 2024
@laurentschoelens
Copy link
Collaborator

@alerosmile another PR to fix this : #504 -> build is OK now and for another configuration (without catalog but only binding) too

@laurentschoelens
Copy link
Collaborator

@alerosmile (sorry 😄 ) new PR : #505

laurentschoelens added a commit to laurentschoelens/jaxb-tools that referenced this issue Feb 22, 2024
mattrpav pushed a commit that referenced this issue Feb 22, 2024
laurentschoelens added a commit that referenced this issue Feb 22, 2024
@laurentschoelens laurentschoelens self-assigned this Feb 22, 2024
@laurentschoelens laurentschoelens added this to the 2.0.10 milestone Feb 22, 2024
@laurentschoelens
Copy link
Collaborator

Fixed in jaxb-tools-2.x and in main branch (will do backport in v3 too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug maven-plugin Issue concerns maven plugin
Projects
None yet
Development

No branches or pull requests

2 participants