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

[#438] get version of XJC at runtime and dump it on source generation #440

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

laurentschoelens
Copy link
Collaborator

Fixes #438

* @return currently running XJC version
*/
public XJCVersion getVersion() {
return XJCVersion.empty();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we make this a XJCVersion.NOT_DETECTED; <-- static string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will define static instance UNDEFINED

package org.jvnet.jaxb.maven;

public class XJCVersion {
private String raw = "N/A";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a public static final String NOT_DETECTED = "NOT DETECTED" <-- as a way to signal to users that there is a tooling version mismatch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method isKnown will return true if at least one version (major, minor, bugfix) is > 0

}
}

public static XJCVersion empty() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't love this.. seems like a static constant could work instead?

Copy link
Collaborator

@mattrpav mattrpav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mattrpav mattrpav merged commit 7085316 into highsource:master Oct 13, 2023
3 checks passed
@mattrpav mattrpav deleted the jt-438 branch October 13, 2023 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement maven-plugin Issue concerns maven plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get XJC Version from Mojo
2 participants