You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Neimoidia <ne...@endspace.com> on 2008/04/02 05:39:34 UTC

During compile, use the related jar instead of the target/classes directory

HI,
for a very very very complex project, I need a hack in order to build my
projects.
I have a parent pom, and 170 modules.
One of this module, is in fact a fake, means that i dont want maven to build
the associate jar because he cant (we have circular dependencies between
this project and 40 of the others modules). So this fake module is build
under eclipse, a jar is generated and deploy into archiva, so the others
modules could use this faxe project as a dependency.
You will tell me why "declared this project as a maven project if i m using
eclipse to build it". Because it holds many properties files, and i m using
assembly to build an archive file of all properties files of all projects
(this is a customer requirement...).
I declared this fake project as a pom packaging project, so when it will be
build, it will deploy a pom artifact to archiva, and not a jar (otherwise it
will be replace the real jar build into eclipse).
The problem is during the "mvn compile" launch from the parent pom, the
others projects who have a dependency to this fake project, use as a
classpath the target/classes directory, which is empty of course, because it
s a pom packaging.
My question is: could i tell some projects to always use the jar deployed in
archiva instead of using target/classes?

NB: when i launched the mvn compile from a project with a dependency to this
fake project, the buils is successful of course, cause he used the jar in
order to compile.
Thks for listening :)

Re: During compile, use the related jar instead of the target/classes directory

Posted by Jan Fredrik Wedén <jf...@gmail.com>.
On Wed, Apr 2, 2008 at 5:39 AM, Neimoidia <ne...@endspace.com> wrote:
> HI,
>  for a very very very complex project, I need a hack in order to build my
>  projects.
>  I have a parent pom, and 170 modules.
>  One of this module, is in fact a fake, means that i dont want maven to build
>  the associate jar because he cant (we have circular dependencies between
>  this project and 40 of the others modules). So this fake module is build
>  under eclipse, a jar is generated and deploy into archiva, so the others
>  modules could use this faxe project as a dependency.
>  You will tell me why "declared this project as a maven project if i m using
>  eclipse to build it". Because it holds many properties files, and i m using
>  assembly to build an archive file of all properties files of all projects
>  (this is a customer requirement...).
>  I declared this fake project as a pom packaging project, so when it will be
>  build, it will deploy a pom artifact to archiva, and not a jar (otherwise it
>  will be replace the real jar build into eclipse).
>  The problem is during the "mvn compile" launch from the parent pom, the
>  others projects who have a dependency to this fake project, use as a
>  classpath the target/classes directory, which is empty of course, because it
>  s a pom packaging.
>  My question is: could i tell some projects to always use the jar deployed in
>  archiva instead of using target/classes?
>
>  NB: when i launched the mvn compile from a project with a dependency to this
>  fake project, the buils is successful of course, cause he used the jar in
>  order to compile.
>  Thks for listening :)
>

You could perhaps exclude the "fake" project from the modules section
where it is listed so it will not be part of the reactor build. Since
you want to reference the jar in the repository it seems like you
don't need it in the reactor in the first place. This should make all
projects reference the jar from repo.

Or you could bind the resources plugin back into the fake project's
pom in order for reactor builds to always use the latest properties
files. This may lead to inconsistencies since you must remember to
build with eclipse and deploy even if the reactor build is successful.

-- 
- Jan Fredrik Wedén

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org