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

Re: Pointing maven-javadoc-plugin to a different repository



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi David

On 30/12/12 20:08, David Paleino wrote:
> I already asked on #d-devel and #d-java, but no-one replied. I
> guess because no-one knew the answer :)
> 
> Here's the issue: I'm updating apache-mime4j to a newer upstream
> version. Before, the source shipped a precompiled (javadoc)
> apidocs, so I just installed it into a libapache-mime4j-java-doc
> package.
> 
> Now, upstream stripped the precompiled apidocs from the tarball,
> and now I'm in need of running "maven javadoc:javadoc". And here's
> the problem: maven is looking for the just-compiled artifacts in
> /usr/share/maven-repo.
> 
> I tried pointing maven to debian/foo/usr/share/maven-repo (via a
> local settings.xml), but then it misses some other artifacts it
> needs to run javadoc.
> 
> Then I tried adding the following line to the project's pom.xml,
> inside maven-javadoc-plugin's <configuration>:
> 
> <localRepository>${basedir}/debian/libapache-mime4j-java/usr/share/maven-repo</localRepository>
>
>  but during compilation I obtain:
> 
> --->8--- [ERROR] BUILD ERROR [INFO]
> ------------------------------------------------------------------------
>
> 
[INFO] Failed to configure plugin parameters for:
> org.apache.maven.plugins:maven-javadoc-plugin:2.6.1
> 
> (found static expression: 
> '/home/david/deb/git/my/apache-mime4j/debian/libapache-mime4j-java/usr/share/maven-repo'
>
> 
which may act as a default value).
> 
> 
> Cause: Cannot assign configuration entry 'localRepository' to
> 'interface org.apache.maven.artifact.repository.ArtifactRepository'
> from 
> '/home/david/deb/git/my/apache-mime4j/debian/libapache-mime4j-java/usr/share/maven-repo',
>
> 
which is of type class java.lang.String
> ---8<---
> 
> Now I've run out of ideas. The only idea remaining is manually
> running javadoc(1).
> 
> Does some of the readers of this mailing list know how to handle
> this situation in an elegant way, by configuring
> maven-javadoc-plugin?

This should be easy to handle using maven-debian-helper - which I'm
assuming you are using to build your new version of the package - it
takes alot of the headache out of using maven in an offline package
build process.

By default mdh will use the 'package' target when building the source
code; you can change this to 'install' so that the resulting jar files
get installed to the local repo during the build - the javadoc target
will then pick up the sources which have just been built OK.  Set the
install target in debian/rules using something like:

DEB_MAVEN_BUILD_TARGET := install

This can create issues when you get circular dependencies in the build
process (the jar files already exist and cannot be overwritten) but in
this case I think it will just work OK.

Hope that helps

Cheers

James

- -- 
James Page
Ubuntu Core Developer
Debian Maintainer
james.page@ubuntu.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBCAAGBQJQ6pxiAAoJEL/srsug59jDj9YP/1liEnskD0F9jAPmBTEUoAuD
ZvAVLB8/dl2E3QNhLQHazj5TLU7iNr3U7EXi8L7iaJuJs9+m5W4q3gdiB3k3toa5
4JmvcIKjhFwsihwyLJDbUtaUiOnu0FoQOGzFqDQOr4ztYqsiw4ZONt4LsrarlUuO
DbwKSW3JAhtztLJlWWiBSnNQvYBFUcb6ja4tP0z4lqRKD7keV2Lw89xA3dU34xkH
9nn6SmnGreD9aoqAiXo/hvmxqr7qKn6TXmYRthJ+g+fgvuc6HbXzUwwgppdt9y9L
dJOp/QRciywJw2BFJSFdQ+hUZgFabbMLJrOjvRfc9rFV6VJrRdcc/0nODdGUB+2f
ofnwYvphaOx5xrD5BfrGaGgxzZ3FDWdgqLmtgEJL0jdNuWh/2EG/6nHnktUdC+GY
YtkvAXIwPznMu3m5Fs1QVce8M8J7yJRtfuate5cV3PEGo7WJwN/P4sMZvXkrwViM
0tXZ/V75sK7KatL0NzI9ej7r/eT/9pYcfGxi7EPTh4P6trEV7TEyFbs/Mcly0cfc
IwiB0tpamGTAl/+aCaQlhaYPnI7X5ue4qEi/9wIN9nlFi9ehJvnY3NL237MGzQXU
4p/RIeu62f9paNoIYXE8BMMAfjob0mEBhdYQf1a9x0+6Pp+5fMq7VJk1aB4cBtWh
40GghUtgQojNSm5jZqnF
=woHU
-----END PGP SIGNATURE-----


Reply to: