On 18/01/2008, Adamson, Eric (DIT) <[EMAIL PROTECTED]> wrote:
> I'm relatively new to Maven 2, and am seeking advice regarding the
> following problem: I have written a data transfer object
> (MailMergeRequest) that will be passed (serialized to XML using Xstream)
> between web client, app server and database. The client and app server
> are running JDK5, the database (Oracle 10g) has an internal JVM, version
> 1.4.2_06. I'll be creating a JAR file for each tier.
>
> I understand re: "one POM, one artifact", and hence expect to break this
> into three separate projects. Since all JARs must contain this data
> transfer object, I'm trying to decide the best way (or at least a very
> good one) of keeping the three projects in sync.
We are in the process of migrating quite a few Ant based projects to
Maven. Those projects had the requirement to have the same class in 2
jars (for bad technical reasons that I wont explain here). Before we
can actually spend the time needed to clean that up, we did as follow
:
Have all sources for all modules in the parent src folder. Create a
subfolder with a pom.xml for each module. Configure those modules to
fetch their sources from the parent src folder. Configure the
maven-compiler-plugin to include the needed sources in the jar. So
more or less :
project
|-- module1
| \-- pom.xml
|-- module2
| \-- pom.xml
|-- module3
| \-- pom.xml
|-- src
| \-- main
| \-- java
\-- pom.xml
with the module1 pom having some thing like :
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<includes>
<include>**/package/to/include/**</include>
</includes>
</configuration>
</plugin>
This is definitely a dirty hack, but it can be quite flexible ...
--
Jabber : [EMAIL PROTECTED]
Skype : Guillaume.Lederrey
Projects :
* http://rwanda.wordpress.com/
* http://rwandatech.wordpress.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]