Skip to content

Commit

Permalink
Fix maven BuildIT failures
Browse files Browse the repository at this point in the history
The dependency `stax-api` is not compatible with the dependency `quarkus-jaxb` because both add the same type `javax.xml.namespace.QName`. This was done on purpose to validate the `parent-first-artifacts` property when building projects with conflicts with Maven, so we need to skip the JaxbContext validation at build time.

This pull request should fix all the CI failures in the latest pull requests.
  • Loading branch information
Sgitario committed Mar 1, 2023
1 parent 2600e8f commit 42a81a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,11 @@ void setupJaxbContextConfig(JaxbConfig config,

// parse class names to class
Set<Class<?>> classes = getAllClassesFromClassNames(classNamesToBeBound);
// validate the context to fail at build time if it's not valid
validateContext(classes);
if (config.validateJaxbContext) {
// validate the context to fail at build time if it's not valid
validateContext(classes);
}

// register the classes to be used at runtime
jaxbContextConfig.addClassesToBeBound(classes);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED, name = "jaxb")
public class JaxbConfig {

/**
* If enabled, it will validate the default JAXB context at build time.
*/
@ConfigItem(defaultValue = "true")
public boolean validateJaxbContext;

/**
* Exclude classes to automatically be bound to the default JAXB context.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
quarkus.class-loading.parent-first-artifacts=stax:stax-api
# The dependency `stax-api` is not compatible with the dependency `quarkus-jaxb` because both add the same
# type `javax.xml.namespace.QName`. This was done on purpose to validate the `parent-first-artifacts` property when building
# projects with conflicts with Maven, so we need to skip the JaxbContext validation at build time.
quarkus.jaxb.validate-jaxb-context=false

0 comments on commit 42a81a6

Please sign in to comment.