Sure - but the problem is that they all use the same sources.  And
refactoring the code base into 4 separate modules is not really an option.

Right now I'm playing around with poms in subfolders that use :
<sourceDirectory>${basedir}/..</sourceDirectory>

but that means I have to override all the defaults in the maven pom, which
is a royal nuissance.  And I'm not even convinced that all plugins will
work properly.

Thanks,

Eric


On Wed, May 18, 2016 at 11:51 AM, Jeff Jensen <jjen...@apache.org> wrote:

> Best is to move them to 4 separate modules/directory structures.  Then it
> will work without issues.
>
> On Wed, May 18, 2016 at 10:36 AM, Eric B <ebenza...@gmail.com> wrote:
>
>> Hi,
>>
>> I am migrating a legacy app to maven and am having miserable time with
>> one module in particular.  The way the Ant script worked is that it built 3
>> or 4 artifacts from the same code base.
>>  - secure-EJB.jar (some subset of classes)
>>  - secure-EJB-client.jar (client EJB)
>>  - unsecure-EJB.jar (another subset of classes)
>>  - library.jar (regular java library with the bulk of classes, apart from
>> the EJB beans/facades)
>>
>>
>> At first I tried to get Maven to build everything via a single pom, but
>> that was just a recipe for disaster (and broke just about every maven
>> convention I know), so I abandoned the concept altogether.
>>
>> Instead, I ended up with 4 poms - each building to a separate target/
>> folder:
>> - pom.xml (parent pom, defines all the dependencies required for the
>> build, and includes the 3 next poms as modules)
>> - pom-ejb-secure.xml (inherits pom.xml)
>> - pom-ejb-unsecure.xml (inherits pom.xml)
>> - pom-jar.xml (inherits pom.xml)
>>
>>
>> pom.xml (snippet):
>>
>> <modelVersion>4.0.0</modelVersion>
>> <artifactId>ejb-pom</artifactId>
>>         <groupId>org.myc</groupId>
>> <packaging>pom</packaging>
>>
>>
>> <modules>
>> <module>pom-securedEjb.xml</module>
>> <module>pom-unsecuredEjb.xml</module>
>> <module>pom-jar.xml</module>
>> </modules>
>>
>> <properties>
>> <skipTests>true</skipTests>
>> </properties>
>>          ...
>>          ...
>>
>>
>> From a command line build (ex: mvn clean deploy), everything works
>> properly, and as expected.  All artifacts are independently built and
>> deployed, at the cost of recompiling the classes for each pom.
>>
>> However, I have no idea how to load/configure this in Eclipse/m2e such
>> that it sees the different artifacts produced, and more importantly is able
>> to resolve against them when referenced in other open projects (Enable
>> Workspace Resolution).
>>
>> When I import the maven project, it just "loads" the parent pom.xml and
>> does not recognize that there are modules that need to be loaded/resolved
>> as well.
>>
>> Is there anything I can do about this?
>>
>> Thanks,
>>
>> Eric
>>
>>
>> _______________________________________________
>> m2e-users mailing list
>> m2e-users@eclipse.org
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/m2e-users
>>
>
>
> _______________________________________________
> m2e-users mailing list
> m2e-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/m2e-users
>
_______________________________________________
m2e-users mailing list
m2e-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users

Reply via email to