[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to replace javax.xml.bind in milib



On Sun, Jan 27, 2019 at 12:25:35AM +0100, Andreas Tille wrote:
> Hi Tony,
> 
> On Sat, Jan 26, 2019 at 10:52:46AM -0800, tony mancill wrote:
> > On Sat, Jan 26, 2019 at 11:11:36AM +0100, Andreas Tille wrote:
> > > [INFO] ------------------------------------------------------------------------
> > > [ERROR] Failed to execute goal on project milib: Could not resolve dependencies for project com.milaboratory:milib:jar:1.9: The following artifacts could not be resolved: javax.xml.bind:jaxb-core:jar:debian, javax.xml.bind:jaxb-runtime:jar:debian: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact javax.xml.bind:jaxb-core:jar:debian has not been downloaded from it before. -> [Help 1]
> > > [ERROR] 
> > > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> > > [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> > > [ERROR] 
> > > [ERROR] For more information about the errors and possible solutions, please read the following articles:
> > > [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
> > > 
> > > 
> > > Am I missing something?
> > 
> > Based on that error message, the build system is trying to find the
> > jaxb-core and jaxb-runtime JARs locally (since the Debian toolchain
> > doesn't allow it pull things from the Internet - this is why all of
> > these builds "just work" outside of the Debian context).
> > 
> > Therefore, you should add libjaxb-java as a build-dep, which will add
> > the following JARs to the local maven repo during the build:
> 
> Hmmm, the Build-Depends was set in the build creating the error above.
>  
> > /usr/share/java/jaxb-core.jar
> > /usr/share/java/jaxb-jxc-jdk9.jar
> > /usr/share/java/jaxb-jxc.jar
> > /usr/share/java/jaxb-runtime.jar
> > /usr/share/java/jaxb-xjc-jdk9.jar
> > /usr/share/java/jaxb-xjc.jar
> > /usr/share/java/jaxb-impl.jar
> > 
> > You might also want to include libjaxb-java as a dependency of your
> > binary package.
> 
> I added this but there must be another trick to get the package built.

Hello Andreas,

Sorry, I should have provided more information.  The maven coordinates
for the jaxb-core and jaxb-runtime don't have the same group id as
jaxb-api.  Or put another way, the path for the jaxb-runtime in the local
maven repo is different than it is for jaxb-api.

$ find /usr/share/maven-repo | grep jaxb-runtime/
/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/debian
/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/debian/jaxb-runtime-debian.jar
/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/debian/jaxb-runtime-debian.pom
/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/2.3.0.1
/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/2.3.0.1/jaxb-runtime-2.3.0.1.pom
/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/2.3.0.1/jaxb-runtime-2.3.0.1.jar
                      ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^   
                      groupId            artifactId   version

As compared to jaxb-api, which has groupId javax.xml.bind:

$ find /usr/share/maven-repo | grep jaxb-api/
/usr/share/maven-repo/javax/xml/bind/jaxb-api/debian
/usr/share/maven-repo/javax/xml/bind/jaxb-api/debian/jaxb-api-debian.jar
/usr/share/maven-repo/javax/xml/bind/jaxb-api/debian/jaxb-api-debian.pom
/usr/share/maven-repo/javax/xml/bind/jaxb-api/2.3.1
/usr/share/maven-repo/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar
/usr/share/maven-repo/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.pom


By looking at this error message:

> [ERROR] Failed to execute goal on project milib: Could not resolve dependencies for project com.milaboratory:milib:jar:1.9: The following artifacts could not be resolved: javax.xml.bind:jaxb-core:jar:debian, javax.xml.bind:jaxb-runtime:jar:debian: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact javax.xml.bind:jaxb-core:jar:debian has not been downloaded from it before. -> [Help 1]

We see that maven was looking for jaxb-runtime in the local repo here:

/usr/share/maven-repo/javax/xml/bind/jaxb-runtime/debian/...
                     |---groupId---| |-artifact-| |ver-| 

When in fact the libjaxb-java package installs the maven metadata here:

/usr/share/maven-repo/org/glassfish/jaxb/jaxb-runtime/debian/...
                     |-----groupId-----| |-artifact-| |ver-| 

I pushed a commit to master (also attached) that updates the patch you
created and the package is building for me locally.  So you almost had
it; you just needed to set the groupId correctly.

Regarding the version specified in the patch, during the build the
version in the pom.xml gets replaced with "debian" unless there is some
other treatment/mapping based on debian/maven.rules, so that I specified
2.3.0.1 for the version isn't strictly necessary.  (But it does document
the version we were using when the patch was written.)

Cheers,
tony
commit f95dafbd852b62ca71ff3ad13f6cfebee07855f2
Author: tony mancill <tmancill@debian.org>
Date:   Sat Jan 26 19:53:49 2019 -0800

    update maven coordinates for jaxb-core and jaxb-runtime

diff --git a/debian/patches/jaxb.patch b/debian/patches/jaxb.patch
index c068336..dfe2839 100644
--- a/debian/patches/jaxb.patch
+++ b/debian/patches/jaxb.patch
@@ -14,14 +14,14 @@ Description:  Fri, 25 Jan 2019 18:41:59 +0100
 +            <version>2.3.1</version>
 +        </dependency>
 +        <dependency>
-+            <groupId>javax.xml.bind</groupId>
++            <groupId>org.glassfish.jaxb</groupId>
 +            <artifactId>jaxb-core</artifactId>
-+            <version>2.3.1</version>
++            <version>2.3.0.1</version>
 +        </dependency>
 +        <dependency>
-+            <groupId>javax.xml.bind</groupId>
++            <groupId>org.glassfish.jaxb</groupId>
 +            <artifactId>jaxb-runtime</artifactId>
-+            <version>2.3.1</version>
++            <version>2.3.0.1</version>
 +        </dependency>
      </dependencies>
  

Attachment: signature.asc
Description: PGP signature


Reply to: