If I was doing this, I would make projects to hold the shared code and build these into libraries. Then I would make a OS specific project that had these libraries as dependencies. I would add an Maven Assembly to each of the top level projects that built a package consisting of the OS-specific top level stuff combined with all of the dependencies including my shared libraries.

Projects
LIB1 contains shared OS-independent code relating to functional area 1
LIB2 contains shared OS-independent code relating to functional area 2
LIB3 contains shared Windows code relating to functional area xxx
LIB4 contains shared Linux code relating to functional area yyy
PROJ5 contains main Windows Code and depends on
   - LIB1
   - LIB2
   - LIB3
PROJ6 contains main Windows Code and depends on
   - LIB1
   - LIB2
   - LIB4

PROJ5 and PROJ6 have Assemblies that build an output artifact containing all the code required to run on their respective OS's.

Ron


Stephen Connolly wrote:
You have project A which has your source

Then you have project A-linux which depends on A and adds the linux deps

project A-win which depends on A and adds the windows deps

Then if you need the windows specific version, you depend on A-win, and
depend on A-linux for the linux specific version.

Alternatively, if the windows deps do not overlap the linux deps (i.e. they
don't provide the same classes) then you could just add both sets of deps to
A with <optional>true</optional>, or perhaps use provided scope and remember
to add them back in.

-Stephen

2010/1/27 <roberto.cal...@embraer.com.br>

Thank you for answering, Stephen. I'll do two projects, but new questions
arise from this:

1 - how can I create 2 projects (2 poms) that uses the same src?

2 - If I have this project A that uses dependencies based on system, I'll
create a A_win and A_linux. I have many other projects B, C, D, E that
uses A, will I have to create 2 projects for each of them?

Thanks

Roberto Soares Caldas

Stephen Connolly wrote:

dependencies included in profiles activated based on jdk or os is a "bad
thing"

the dependencies will be pulled in based on the _system doing the build_
not
on the _target system_

better is to produce two separate projects which add the required
dependencies

2010/1/27 <roberto.cal...@embraer.com.br>

I am using profiles to build a jar with different dependencies -
sometimes
I have to use a dependency for linux64 and sometimes for win32. I have
another project that adds this project as dependency and I'm not able to
somehow "propagate" this profile utilization to this other project, that
is, when I try to make "mvn install -Plinux64" I always get a MANIFEST
with the win32 dependency - the active by default.  So my question is,
if
I have a project whose its dependency has multiple profiles, how do I
activate them when trying to install this project?

I'm using Maven 2.0.9.

Sorry for my bad English, please tell me if I was not clear.
Thank you.

Roberto
This message is intended solely for the use of its addressee and may
contain privileged or confidential information. All information contained
herein shall be treated as confidential and shall not be disclosed to any
third party without Embraer?s prior written approval. If you are not the
addressee you should not distribute, copy or file this message. In this
case, please notify the sender and destroy its contents immediately.
Esta mensagem é para uso exclusivo de seu destinatário e pode conter
informações privilegiadas e confidenciais. Todas as informações aqui
contidas devem ser tratadas como confidenciais e não devem ser divulgadas
a terceiros sem o prévio consentimento por escrito da Embraer. Se você não
é o destinatário não deve distribuir, copiar ou arquivar a mensagem. Neste
caso, por favor, notifique o remetente da mesma e destrua imediatamente a
mensagem.





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

Reply via email to