Putting in Hudson a Maven project with a non-repository resource

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Putting in Hudson a Maven project with a non-repository resource

Fabrizio Giudici
Hi.

One of my projects depends on an artifact that is not available in any
Maven repository. On my laptop this works:

mvn -B -fn install:install-file -DgroupId=com.sun.media
-DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar
-Dfile=${WORKSPACE}/src/lib/jai_imageio-1_1/lib/jai_imageio.jar

...

[INFO] [install:install-file]
[INFO] Installing
/home/fgiudici/Hudson/jobs/Mistral/workspace/jdk/JDK_1.5.0_18/src/lib/jai_imageio-1_1/lib/jai_imageio.jar
to
/home/fgiudici/Hudson/jobs/Mistral/workspace/jdk/JDK_1.5.0_18/.repository/com/sun/media/jai_imageio/1.1/jai_imageio-1.1.jar

where jai_imageio.jar is the missing library and it's committed with the
sources.


And later I can compile everything without problems. In Hudson I've set
up a free style project with TWO maven build steps:

1. Goals -B -fn install:install-file -DgroupId=com.sun.media
-DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar
-Dfile=${WORKSPACE}/src/lib/jai_imageio-1_1/lib/jai_imageio.jar
Props maven.repo.local=${WORKSPACE}/.repository

2. Goals -B -fn clean install
Props maven.repo.local=${WORKSPACE}/.repository
maven.test.skip=true
JAVA_HOME=${JAVA_HOME}



(tests are skipped as I've got still an issue with them). This doesn't
work and when I compile the code depending on the library, I get missing
symbols.



--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
[hidden email] - mobile: +39 348.150.6941


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Putting in Hudson a Maven project with a non-repository resource

Kohsuke Kawaguchi
Administrator

I think you'd want to host your own Maven repository (or in case of
jai_imageio, I think you can just push this to the java.net m2
repository) so that you don't have to do two steps.

That said, this is really strange. When your "install:install-file"
runs, Maven should have reported where it's installing a file to in your
local repository. Can you find that and see if that's pointing to the
right place?


Fabrizio Giudici wrote:

> Hi.
>
> One of my projects depends on an artifact that is not available in any
> Maven repository. On my laptop this works:
>
> mvn -B -fn install:install-file -DgroupId=com.sun.media
> -DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar
> -Dfile=${WORKSPACE}/src/lib/jai_imageio-1_1/lib/jai_imageio.jar
>
> ..
>
> [INFO] [install:install-file]
> [INFO] Installing
> /home/fgiudici/Hudson/jobs/Mistral/workspace/jdk/JDK_1.5.0_18/src/lib/jai_imageio-1_1/lib/jai_imageio.jar
> to
> /home/fgiudici/Hudson/jobs/Mistral/workspace/jdk/JDK_1.5.0_18/.repository/com/sun/media/jai_imageio/1.1/jai_imageio-1.1.jar
>
> where jai_imageio.jar is the missing library and it's committed with the
> sources.
>
>
> And later I can compile everything without problems. In Hudson I've set
> up a free style project with TWO maven build steps:
>
> 1. Goals -B -fn install:install-file -DgroupId=com.sun.media
> -DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar
> -Dfile=${WORKSPACE}/src/lib/jai_imageio-1_1/lib/jai_imageio.jar
> Props maven.repo.local=${WORKSPACE}/.repository
>
> 2. Goals -B -fn clean install
> Props maven.repo.local=${WORKSPACE}/.repository
> maven.test.skip=true
> JAVA_HOME=${JAVA_HOME}
>
>
>
> (tests are skipped as I've got still an issue with them). This doesn't
> work and when I compile the code depending on the library, I get missing
> symbols.
>
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment