You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Meg Hsu <ev...@gmail.com> on 2005/10/24 23:28:24 UTC

[m2] how to have two jars (api and impl) from one project

Hi all,
 My project has several sub-projects, each project has the following
structure:
 /module1/src/... /module1/api
 ... /module1/impl
 I need to have one jar for the api classes only, and the other of the impl
classes.
Any suggestions on how to do this on M2?
I was using the compiler-plugin's include/exclude, but then I have to have 2
pom.xml files.
 There are also tests that need to be ran for the project.
 Thanks.

Re: [m2] how to have two jars (api and impl) from one project

Posted by Trygve Laugstøl <tr...@codehaus.org>.
On Mon, 2005-10-24 at 15:18 -0700, Meg Hsu wrote:
> Hi Kenney,
>  Thanks for your input. The reason we have such structure is to
> eliminate the situation where the impl classes have references to
> other impl classes instead of api classes in other sub-projects.
> So at compile time, only the api jars will be used.
> The purpose is to reduce the impact when the impl is changed
> in some sub-projects.
>  Right now we have 14 sub-projects. If break them up, there will
> be 28 projects.. Or we need to consolidate some of our projects.
>  Is the Attachments a plug-in? Do you know where I can find more
> info about it?

Another alternative is to put the APIs in one single project which is ok
if this is a single application. That way you won't have components
using other components directly and still have a manageable set of
projects.

--
Trygve


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


Re: [m2] how to have two jars (api and impl) from one project

Posted by Meg Hsu <ev...@gmail.com>.
Hi Kenney,
 Thanks for your input. The reason we have such structure is to
eliminate the situation where the impl classes have references to
other impl classes instead of api classes in other sub-projects.
So at compile time, only the api jars will be used.
The purpose is to reduce the impact when the impl is changed
in some sub-projects.
 Right now we have 14 sub-projects. If break them up, there will
be 28 projects.. Or we need to consolidate some of our projects.
 Is the Attachments a plug-in? Do you know where I can find more
info about it?
 Thanks.
 On 10/24/05, Kenney Westerhof <ke...@apache.org> wrote:

This isn't a recommended project structure. Attachments (that's
what we call it) do exist though, for instance for an ejb project
(the ejb-jar is the main jar, and there's an ejb-client jar with just
the interfaces).

If you separate the api and the impl, there must be a reason for it,
like supporting multiple impls. In that case I'd recommend splitting the
project up. Even if you distribute the api classes to a client and keep
the impl on a server, it's worth separating the projects.

-- Kenney

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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

Re: [m2] how to have two jars (api and impl) from one project

Posted by Kenney Westerhof <ke...@apache.org>.
On Mon, 24 Oct 2005, Meg Hsu wrote:

> Hi all,
>  My project has several sub-projects, each project has the following
> structure:
>  /module1/src/... /module1/api
>  ... /module1/impl
>  I need to have one jar for the api classes only, and the other of the impl
> classes.
> Any suggestions on how to do this on M2?
> I was using the compiler-plugin's include/exclude, but then I have to have 2
> pom.xml files.
>  There are also tests that need to be ran for the project.
>  Thanks.


This isn't a recommended project structure. Attachments (that's
what we call it) do exist though, for instance for an ejb project
(the ejb-jar is the main jar, and there's an ejb-client jar with just
the interfaces).

If you separate the api and the impl, there must be a reason for it,
like supporting multiple impls. In that case I'd recommend splitting the
project up. Even if you distribute the api classes to a client and keep
the impl on a server, it's worth separating the projects.

-- Kenney

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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