diff --git a/jaxb.spec b/jaxb.spec
index dd67335..748815c 100644
--- a/jaxb.spec
+++ b/jaxb.spec
@@ -93,7 +93,8 @@ RelaxNG Datatype library.
# Delete precompiled jar and class files
find -type f '(' -iname '*.jar' -o -iname '*.class' ')' -print -delete
-cd jaxb-ri
+pushd jaxb-ri
+
# Remove unnecessary dep on ee4j parent pom (it adds nothing to our downstream builds)
%pom_remove_parent boms/bom external xsom codemodel
@@ -108,24 +109,30 @@ cd jaxb-ri
scm:git:git@github.com:eclipse-ee4j/ee4j.git
https://github.com/eclipse-ee4j/ee4j
' external
+
# Fix dep on xml resolver
%pom_change_dep com.sun.org.apache.xml.internal:resolver xml-resolver:xml-resolver:1.2 xjc jxc
sed -i -e 's/com\.sun\.org\.apache\.xml\.internal\.resolver/org.apache.xml.resolver/' xjc/src/main/java/com/sun/tools/xjc/CatalogUtil.java
+
# Missing dep in Fedora: org.checkerframework:compiler
%pom_disable_module jxc
+
# Disable unneeded extra OSGi bundles
%pom_disable_module jxc bundles
%pom_disable_module osgi bundles
%pom_disable_module ri bundles
%pom_disable_module runtime bundles
%pom_disable_module xjc bundles
+
# lack of dependency when building documentation
%pom_disable_module release-documentation docs
+
# Compatibility
%mvn_alias com.sun.xml.bind.external:relaxng-datatype com.github.relaxng:relaxngDatatype relaxngDatatype:relaxngDatatype
%mvn_alias org.glassfish.jaxb:jaxb-runtime org.glassfish.jaxb:jaxb-core
%mvn_alias org.glassfish.jaxb:jaxb-xjc com.sun.xml.bind:jaxb-xjc
%mvn_alias org.glassfish.jaxb:xsom com.sun.xsom:xsom
+
# Don't install aggregator and parent poms
%mvn_package :jaxb-bom __noinstall
%mvn_package :jaxb-bom-ext __noinstall
@@ -138,17 +145,17 @@ sed -i -e 's/com\.sun\.org\.apache\.xml\.internal\.resolver/org.apache.xml.resol
%mvn_package :jaxb-samples __noinstall
%mvn_package :jaxb-txw-parent __noinstall
%mvn_package :jaxb-www __noinstall
-cd -
+popd
%build
-cd jaxb-ri
+pushd jaxb-ri
%mvn_build -s -f -j -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
-cd -
+popd
%install
-cd jaxb-ri
+pushd jaxb-ri
%mvn_install
-cd -
+popd
%files codemodel -f jaxb-ri/.mfiles-codemodel
%license LICENSE.md NOTICE.md