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

Re: Building maven packages



On 30.12.2016 04:44, Wookey wrote:
[...]
> 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?

Hmm, not sure.

[...]
--------------------------------------------------
> [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.

You got the "cannot find symbol" error message. This can usually mean

1. The package is not listed in debian/control. Not true in this case
because libmaven2-core-java is there.

2. The package does not contain the classes/methods anymore because they
were already deprecated and then finally removed or they simply changed.
Also not true [1]

3. Your substitution rule is wrong.

These ones are correct

org.apache.maven maven-artifact jar s/.*/2.2.1/ * *
org.apache.maven maven-model jar s/.*/2.2.1/ * *
org.apache.maven maven-plugin-api jar s/.*/2.2.1/ * *

In this case s/.*/3.x won't work because a strict dependency is
required. Maven is somewhat special, the API can easily break and I
believe that is the reason why we neither provide a Debian version or
2.x version. If you look at the filelist you can see that there are only
2.2.1 versions.

https://packages.debian.org/sid/all/libmaven2-core-java/filelist

Afterwards compilation will succeed when you skip the tests.

Just add maven.test.skip=true to maven.properties in your debian
directory. I haven't investigated why the tests don't work though, maybe
it can be trivially solved.

Regards,

Markus


[1]
https://sources.debian.net/src/maven2-core/2.2.1-26/maven-artifact/src/main/java/org/apache/maven/artifact/factory/



Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: