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

Re: Building maven packages



On 2016-12-30 02:07 +0100, Emmanuel Bourg wrote:
> Le 30/12/2016 à 01:59, Wookey a écrit :
> 
> > which looks like what's wanted.
> 
> Not exactly, the project wants bcel:bcel:5.x and we provide
> org.apache.bcel:bcel:5.x, the groupId is different.

Right. I eventually found https://wiki.debian.org/Java/MavenRepoHelper
which had some useful examples so I grokked what was going on. I've
added Markus's info on what the 6 components of the rules are to that
page now.
 
> Try this rule instead:
> 
>     s/bcel/org.apache.bcel/ bcel * s/.*/debian/ * *

You would think that would work, but because the bcel dependency is listed twice, once with a version and once not you have to have two rules:
bcel bcel * s/5\.1/5.x/ * *
s/bcel/org.apache.bcel/ bcel * * * *

otherwise it substitues in the top-level pom (where there is a
version), but it fails to match on the submodule pom and leaves the
groupId as 'bcel'. I spent a while messing with this.

On the other hand, with the next problem (some issue of groupId and version being different) I could do both subs in one line:
s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-plugin-testing-harness * s/.*/debian/ * *

BTW. if I try to use mh_patchpoms -plibmaven-native-java and
mh_unpatchpoms -plibmaven-native-java to test if my rules are right
(quicker than doing a build), I get dpkg-source complaining that all
the pom.xml files have changed from the orig. I think this is a
dos/unix linefeed issue (the patch alleges that every line has
changed...). How does this work doing the build, but not work using
mh_patchpoms/mh_unpatchpoms?

Is that a bug?

So, having got past that lot I'm on to something that looks like an actual build error :-)

[INFO] Building Native Maven Plugin 1.0-alpha-8
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ native-maven-plugin ---
[WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ native-maven-plugin ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding ANSI_X3.4-1968, i.e. build is platform dependent!
[INFO] Compiling 13 source files to /home/wookey/packages/jscience/maven-native-plugin/debian/maven-native-1.0alpha8/native-maven-plugin/target/classes
[INFO] /home/wookey/packages/jscience/maven-native-plugin/debian/maven-native-1.0alpha8/native-maven-plugin/src/main/java/org/codehaus/mojo/natives/plugin/AbstractNativeMojo.java: Some input files use unchecked or unsafe operations.
[INFO] /home/wookey/packages/jscience/maven-native-plugin/debian/maven-native-1.0alpha8/native-maven-plugin/src/main/java/org/codehaus/mojo/natives/plugin/AbstractNativeMojo.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/wookey/packages/jscience/maven-native-plugin/debian/maven-native-1.0alpha8/native-maven-plugin/src/main/java/org/codehaus/mojo/natives/plugin/NativeLinkMojo.java:[33,41] package org.apache.maven.artifact.factory does not exist
[ERROR] /home/wookey/packages/jscience/maven-native-plugin/debian/maven-native-1.0alpha8/native-maven-plugin/src/main/java/org/codehaus/mojo/natives/plugin/NativeLinkMojo.java:[153,13] cannot find symbol
  symbol:   class ArtifactFactory
  location: class org.codehaus.mojo.natives.plugin.NativeLinkMojo

so it seems that org/apache/maven/maven-artifact is installed, and that's what the dependency is named as, but in the file native-maven-plugin/src/main/java/org/codehaus/mojo/natives/plugin/AbstractNativeMojo.java it's:
import org.apache.maven.artifact.factory.ArtifactFactory;
should that be
import org.apache.maven.maven-artifact.factory.ArtifactFactory;  ?

but in that case how does this work upstream? Is there a better way of
finding the classes in a jar than unzip foo.jar | strings?

patching the file to load
org.apache.maven.maven-artifact.factory.ArtifactFactory doesn;t work -
it complains about missing semicolons, which I guess means that '-'
isn't permitted in import paths like this. So I'm a bit flumoxed now.

I've updated the tarball to current state of play. 

Wookey
-- 
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/

Attachment: signature.asc
Description: Digital signature


Reply to: