On 4/3/06, Calum Shaw-Mackay <[EMAIL PROTECTED]> wrote:
>
> Hello
>
> I'm just starting out using Maven for some of my projects and I have a
> couple of questions
>
> How do I in a my pom.xml indicate that I want a subset of my source
> compiled to a separate directory using 1.4, whilst having the whole
> source (including the subset) compiled to 1.5 in another directory


Essentially, this is for jini-like projects where you can run the main
> application under 1.5 but clients to the service maybe running under
> 1.4
>
> I then want to add them as separate artifacts; one for the downloaded
> files for the service, one for the interfaces that the clients are
> compiled against and another for the actual service.
>
> I'm thinking of using profiles, as a start.....
>
> Any help or pointers would be greatly appreciated
>
> Thanks
>
>    --Calum


Maven does not generally condone this. It actually explicitly removes
certain elements around source and output directories that exist in the
<project><build /></project> element from <profile><build /></profile>
element. (Profile being the block that would allow a jdk1.5 build to differ
from a jdk1.4 build). This means that you cannot create a structure like:
src/main/java14 to be active under one profile, and src/main/java15 under
another. If you find yourself seperating source code, its time to think
about seperating them into seperate projects.

I'm not saying it's not possible (anything is, you can always write a
plugin, or hack it with an ant plugin configuration), but Maven is more than
about being easy to use, but also clean up and standardize the projects that
use it. Trust me, its far simpler to just accept that Maven will make
certain demands of your project structure in order for it to play nice back.
Its like a volcano god that demands tribute: It will keep your project nice
and green, all it asks is for in return the occasional virgin. Ultimately,
it makes things easier in the long run.

Eric

Reply via email to