You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Robert Bjarum <ro...@tellu.no> on 2007/10/03 17:50:19 UTC

Multiple source directories

24SevenOffice, the world leading web-based ERP system, has checked this mail for viruses. 
 Hi all,

I principle, I agree with those who say it is against "Best Practice" to have mulitply source directories in a project.

However, I have run into this situation taking an existing project over to maven an would like to hear your opinions/advice.

We have two projects, one under J2SE and one under J2ME (WTK). Common classes have been organized in a seperate source directory which is shared by the two projects.

Server application (J2SE project):
    server/pom.xml
    server/src/main/java
    commonplatform/src/main/java  (used by both project, but compiled differently)

Mobile application (J2ME project):
    mobile/pom.xml
    mobile/src/main/java
    commonplatform/src/main/java  (used by both project, but compiled differently)

This can be solved in several ways:
a) Defining 2 addition projects creating common-j2se.jar and common-j2me.jar
b) Using multiple sources using build-helper-maven-plugin from org.codehaus
c) Using <sourceModifications> in some way

Any good recommendations or opinions?

Regards,
Robert Bjarum

Re: Multiple source directories

Posted by Dan Tran <da...@gmail.com>.
here is my version

 parent
      src/main/java <--- common source go here
      server
          src/main/java
      mobile
          src/main/java


Use your option 'b' to inject common source directory to server/mobile builds.

This way, changes in the common source apply to both server and mobile jars


-D

On 10/3/07, Robert Bjarum <ro...@tellu.no> wrote:
> 24SevenOffice, the world leading web-based ERP system, has checked this mail
> for viruses.
> Hi all,
>
> I principle, I agree with those who say it is against "Best Practice" to
> have mulitply source directories in a project.
>
> However, I have run into this situation taking an existing project over to
> maven an would like to hear your opinions/advice.
>
> We have two projects, one under J2SE and one under J2ME (WTK). Common
> classes have been organized in a seperate source directory which is shared
> by the two projects.
>
> Server application (J2SE project):
>     server/pom.xml
>     server/src/main/java
>     commonplatform/src/main/java  (used by both project,
> but compiled differently)
>
> Mobile application (J2ME project):
>     mobile/pom.xml
>     mobile/src/main/java
>     commonplatform/src/main/java  (used by both project,
> but compiled differently)
>
> This can be solved in several ways:
> a) Defining 2 addition projects creating common-j2se.jar and common-j2me.jar
> b) Using multiple sources using build-helper-maven-plugin from org.codehaus
> c) Using <sourceModifications> in some way
>
> Any good recommendations or opinions?
>
> Regards,
> Robert Bjarum
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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