You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by William Ferguson <Wi...@yarris.com> on 2006/12/03 22:46:37 UTC

RE: [***POSSIBLE SPAM***] - How to create multiple jar files from one project? - Bayesian Filter detected spam

Peter,

I don't think a Maven solution is what you need.
I think you need to rethink the packaging and dependencies of your 2
projects.
It sounds like your interface project shouldn't depend on the Factory in
the implementation project.

You could organise this a couple of different ways:
1) The Factory class could ship with interface project.
2) Ship a Factory interface with your interface project, and ship the
Factory impl in the other project.

Hope this helps.

William 

-----Original Message-----
From: Peter Palmreuther [mailto:lists@pitpalme.de] 
Sent: Sunday, 3 December 2006 9:01 PM
To: Maven Users List
Subject: [***POSSIBLE SPAM***] - How to create multiple jar files from
one project? - Bayesian Filter detected spam

Hello,

I'm new to Maven and tried to find an answer on the website, but either
I'm to dense or it ain't there (yet). So if this question is already
answered in a public available document I'd be happy to get the link.

I have a project that should be a library to encapsulate the logger
being used in all other projects. From this project I create two JAR
files: one containing the interface(s) and a factory, the other one
containing the implementation classes.

By now I'm trying to switch to use Maven2 for project management and
dependency tracking, but I'm still unable to get the two jars out of
Maven build process.

Therefore I've tried to split the project up into two projects to have
two artifacts. But than I end up in a cyclic dependency:

Interface project depends on implementation project for the factory to
compile; Implementation project depends on interface project for the
implementation class to compile (Class implements Interface). A deadlock
:-(

Anybody out there with an idea how to solve this problem "the Maven2
way"? I'd be happy with a hint on
- either how to influence the packaging process for getting two JARs
  (artifacts?) from one POM
- or how to tell the two Maven2 projects they belong "somehow
  together" for dependency resolution in a way it's done as if this
  were one project

Thanks a lot in advance,
--
Best regards
Peter Palmreuther

"Bother," said Pooh as he found he'd used a dirty needle


---------------------------------------------------------------------
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


Re: - How to create multiple jar files from one project? - Bayesian Filter detected spam

Posted by Peter Palmreuther <li...@zentrumderarbeit.org>.
Hello Alexander,

On Sunday, December 3, 2006 at 10:53:57 PM Alexander wrote:

> Yea, I agree...I don't see why interfaces should be dependent on
> implementations?  What's the point?

It doesn't. The *Factory* does, and just *this* factory is (should be)
shipped with the relevant interface, while the implementation should
be shipped separately. Or more precisely: the impl-jar shouldn't be
shipped anywhere, just located in the runtime.

> I don't see how you would have a circular dependency.

I do have. If you don't see it I wasn't able to explain it correctly.

> Your factory classes probably produce instances of your interfaces.

It does.

> Your implementation classes would depend on those interfaces.

Exactly. And for the Factory producing instances it depends on the
implementation class. Which is in a different project / jar. Which
depends on the interface class / jar. Which can't be built due to the
fact it needs the impl-jar (as "<dependency/>" set up in "pom.xml").
Which can't be compiled as it needs the interface class. Which
*aaaaarrrrggggghhhhhh* I'm lost in a recursive explanation!!! ;-)

> Life is good!  :D

Sometimes. Not. :-)

> On 12/3/06, William Ferguson <Wi...@yarris.com> wrote:
>>
>> Peter,
>>
>> I don't think a Maven solution is what you need.
>> I think you need to rethink the packaging and dependencies of your 2
>> projects.
>> It sounds like your interface project shouldn't depend on the Factory in
>> the implementation project.
>>
>> You could organise this a couple of different ways:
>> 1) The Factory class could ship with interface project.
>> 2) Ship a Factory interface with your interface project, and ship the
>> Factory impl in the other project.
>>
>> Hope this helps.
>>
>> William
>>
>> -----Original Message-----
>> From: Peter Palmreuther [mailto:lists@pitpalme.de]
>> Sent: Sunday, 3 December 2006 9:01 PM
>> To: Maven Users List
>> Subject: [***POSSIBLE SPAM***] - How to create multiple jar files from
>> one project? - Bayesian Filter detected spam
>>
>> Hello,
>>
>> I'm new to Maven and tried to find an answer on the website, but either
>> I'm to dense or it ain't there (yet). So if this question is already
>> answered in a public available document I'd be happy to get the link.
>>
>> I have a project that should be a library to encapsulate the logger
>> being used in all other projects. From this project I create two JAR
>> files: one containing the interface(s) and a factory, the other one
>> containing the implementation classes.
>>
>> By now I'm trying to switch to use Maven2 for project management and
>> dependency tracking, but I'm still unable to get the two jars out of
>> Maven build process.
>>
>> Therefore I've tried to split the project up into two projects to have
>> two artifacts. But than I end up in a cyclic dependency:
>>
>> Interface project depends on implementation project for the factory to
>> compile; Implementation project depends on interface project for the
>> implementation class to compile (Class implements Interface). A deadlock
>> :-(
>>
>> Anybody out there with an idea how to solve this problem "the Maven2
>> way"? I'd be happy with a hint on
>> - either how to influence the packaging process for getting two JARs
>>   (artifacts?) from one POM
>> - or how to tell the two Maven2 projects they belong "somehow
>>   together" for dependency resolution in a way it's done as if this
>>   were one project
>>
>> Thanks a lot in advance,
>> --
>> Best regards
>> Peter Palmreuther
>>
>> "Bother," said Pooh as he found he'd used a dirty needle
-- 
Best regards
"Peter Palmreuther <li...@zentrumderarbeit.org>"
(The Bat! v3.86.8 ALPHA (beta) on Windows XP 5.1 Build 2600 Service Pack 2)

"There is no statute of limitations on stupidity."


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


Re: [***POSSIBLE SPAM***] - How to create multiple jar files from one project? - Bayesian Filter detected spam

Posted by Alexander Sack <pi...@gmail.com>.
Yea, I agree...I don't see why interfaces should be dependent on
implementations?  What's the point?  I don't see how you would have a
circular dependency.  Your factory classes probably produce instances of
your interfaces.  Your implementation classes would depend on those
interfaces.  Life is good!  :D

-aps

On 12/3/06, William Ferguson <Wi...@yarris.com> wrote:
>
> Peter,
>
> I don't think a Maven solution is what you need.
> I think you need to rethink the packaging and dependencies of your 2
> projects.
> It sounds like your interface project shouldn't depend on the Factory in
> the implementation project.
>
> You could organise this a couple of different ways:
> 1) The Factory class could ship with interface project.
> 2) Ship a Factory interface with your interface project, and ship the
> Factory impl in the other project.
>
> Hope this helps.
>
> William
>
> -----Original Message-----
> From: Peter Palmreuther [mailto:lists@pitpalme.de]
> Sent: Sunday, 3 December 2006 9:01 PM
> To: Maven Users List
> Subject: [***POSSIBLE SPAM***] - How to create multiple jar files from
> one project? - Bayesian Filter detected spam
>
> Hello,
>
> I'm new to Maven and tried to find an answer on the website, but either
> I'm to dense or it ain't there (yet). So if this question is already
> answered in a public available document I'd be happy to get the link.
>
> I have a project that should be a library to encapsulate the logger
> being used in all other projects. From this project I create two JAR
> files: one containing the interface(s) and a factory, the other one
> containing the implementation classes.
>
> By now I'm trying to switch to use Maven2 for project management and
> dependency tracking, but I'm still unable to get the two jars out of
> Maven build process.
>
> Therefore I've tried to split the project up into two projects to have
> two artifacts. But than I end up in a cyclic dependency:
>
> Interface project depends on implementation project for the factory to
> compile; Implementation project depends on interface project for the
> implementation class to compile (Class implements Interface). A deadlock
> :-(
>
> Anybody out there with an idea how to solve this problem "the Maven2
> way"? I'd be happy with a hint on
> - either how to influence the packaging process for getting two JARs
>   (artifacts?) from one POM
> - or how to tell the two Maven2 projects they belong "somehow
>   together" for dependency resolution in a way it's done as if this
>   were one project
>
> Thanks a lot in advance,
> --
> Best regards
> Peter Palmreuther
>
> "Bother," said Pooh as he found he'd used a dirty needle
>
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson

Re: - How to create multiple jar files from one project? - Bayesian Filter detected spam

Posted by Peter Palmreuther <li...@zentrumderarbeit.org>.
Hello William,

On Sunday, December 3, 2006 at 10:46:37 PM William wrote:

> I don't think a Maven solution is what you need.

OK. Can live with this. I just wanted to make sure *there is none*
before I go the long way and get told later there was a shorter one.

> I think you need to rethink the packaging and dependencies of your 2
> projects.

In fact I do. I took over this project and started to clean up and
introduce Maven ... Rethinking everything is the very first I did ;-)
And I'm not quite finished yet ;-)

> It sounds like your interface project shouldn't depend on the Factory in
> the implementation project.

The factory is part of the interface project:

Interface-Project:
 - Custom logger interface
 - Factory to create such a logger

Implementation-Project:
 - Custom logger
 - some other stuff

(just the relevant parts mentioned)

> You could organise this a couple of different ways:
> 1) The Factory class could ship with interface project.

It does.

> 2) Ship a Factory interface with your interface project, and ship the
> Factory impl in the other project.

*hmm* Good idea, will think about it. But there's still the need
create an instance of something that's in the interface-project. And
this one needs to know something from the implementation. And this
implementation-project needs to know the Interface(s) and this leads
me to: "You most probable need reflection when you want to cut the two
things up".

> Hope this helps.

Sure. Somehow. And if it only enforces me to think about all the stuff
another time ;-)

> -----Original Message-----
> From: Peter Palmreuther [mailto:lists@pitpalme.de] 
> Sent: Sunday, 3 December 2006 9:01 PM
> To: Maven Users List
> Subject: [***POSSIBLE SPAM***] - How to create multiple jar files from
> one project? - Bayesian Filter detected spam

> Hello,

> I'm new to Maven and tried to find an answer on the website, but either
> I'm to dense or it ain't there (yet). So if this question is already
> answered in a public available document I'd be happy to get the link.

> I have a project that should be a library to encapsulate the logger
> being used in all other projects. From this project I create two JAR
> files: one containing the interface(s) and a factory, the other one
> containing the implementation classes.

> By now I'm trying to switch to use Maven2 for project management and
> dependency tracking, but I'm still unable to get the two jars out of
> Maven build process.

> Therefore I've tried to split the project up into two projects to have
> two artifacts. But than I end up in a cyclic dependency:

> Interface project depends on implementation project for the factory to
> compile; Implementation project depends on interface project for the
> implementation class to compile (Class implements Interface). A deadlock
> :-(

> Anybody out there with an idea how to solve this problem "the Maven2
> way"? I'd be happy with a hint on
> - either how to influence the packaging process for getting two JARs
>   (artifacts?) from one POM
> - or how to tell the two Maven2 projects they belong "somehow
>   together" for dependency resolution in a way it's done as if this
>   were one project

> Thanks a lot in advance,
> --
> Best regards
> Peter Palmreuther

> "Bother," said Pooh as he found he'd used a dirty needle
-- 
Best regards
"Peter Palmreuther <li...@zentrumderarbeit.org>"
(The Bat! v3.86.8 ALPHA (beta) on Windows XP 5.1 Build 2600 Service Pack 2)

Don't know what I'm after, but the pressure's driving me insane...


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