Maven 1.x EJB Plugin

ejb:install should also depend and install client

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2
  • Fix Version/s: 1.7
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    4

Description

Need to add into plugin.jelly something like

<j:set var="maven.ejb.final.client.name"
value="${maven.build.dir}/${maven.final.name}-client.jar"/>

<goal name="ejb:install"
prereqs="ejb:ejb,ejb:ejb-client"
description="Install the ejb in the local repository">

<artifact:install
artifact="${maven.ejb.final.name}"
type="ejb"
project="${pom}"/>

<artifact:install
artifact="${maven.ejb.final.client.name}"
type="jar"
project="${pom.client}"/>

</goal>

Not sure how to build pom.client though.

  1. ejb.patch
    28/Nov/03 12:23 AM
    6 kB
    Archimedes Trajano
  2. ejb.patch.patch
    25/May/04 8:01 PM
    0.7 kB
    Tim Shadel
  3. ejb-1.5.patch
    29/Jul/04 7:38 PM
    6 kB
    Tim Shadel
  4. maven-ejb-plugin-ejb-client-support-enhancement.patch
    08/Dec/03 3:13 PM
    5 kB
    John Casey

Issue Links

Activity

Hide
Archimedes Trajano added a comment -

Okay I think I figured it out

<goal name="ejb:install"
prereqs="ejb:ejb,ejb:ejb-client"
description="Install the ejb in the local repository">

<artifact:install
artifact="${maven.ejb.final.name}"
type="ejb"
project="${pom}"/>

<j:set var="artifactId_original"
value="${pom.artifactId}"/>
<j:set var="artifactId_client"
value="${pom.artifactId}-client"/>
<j:expr value="${pom.setArtifactId(artifactId_client)}" />
<artifact:install
artifact="${maven.ejb.final.client.name}"
type="jar"
project="${pom}"/>
<j:expr value="${pom.setArtifactId(artifactId_original)}" />
</goal>

Show
Archimedes Trajano added a comment - Okay I think I figured it out <goal name="ejb:install" prereqs="ejb:ejb,ejb:ejb-client" description="Install the ejb in the local repository"> <artifact:install artifact="${maven.ejb.final.name}" type="ejb" project="${pom}"/> <j:set var="artifactId_original" value="${pom.artifactId}"/> <j:set var="artifactId_client" value="${pom.artifactId}-client"/> <j:expr value="${pom.setArtifactId(artifactId_client)}" /> <artifact:install artifact="${maven.ejb.final.client.name}" type="jar" project="${pom}"/> <j:expr value="${pom.setArtifactId(artifactId_original)}" /> </goal>
Hide
Archimedes Trajano added a comment -

Patch to the files
Includes patches to deploy and snapshots as well. Changed the path to say [id]client[version] instead of [id]-[version]-client

Show
Archimedes Trajano added a comment - Patch to the files Includes patches to deploy and snapshots as well. Changed the path to say [id]client[version] instead of [id]-[version]-client
Hide
John Casey added a comment -

See also:

MAVEN-1068
MPARTIFACT-4

I have created a patch which works with two other patches (see MAVEN-1068 and MPARTIFACT-4) to:

1. Add ArtifactType support to the Dependency.isAddedToClasspath() method, which allows the following:

<dependency>
<groupId>someproject</groupId>
<artifactId>someproject-ejb<artifactId>
<version>1.0</version>
<type>ejb-client</type>
</dependency>

which will result in a dependency on the EJB-client jar, not the EJB jar itself.

2. Add ArtifactType support to the DefaultArtifactDeployer.extensionForType(type) method, which will correctly allow us to use:

<artifact:install-snapshot
artifact="${maven.ejb.client.final.name}"
type="ejb-client"
project="${pom}"/>

which will integrate well into the forseeable future with the artifact-orientation of maven.

3. Provide ejb:install-client, ejb:install-client-snapshot, ejb:deploy-client, and ejb:deploy-client-snapshot.

This will provide EJB-client jarfile control which is fully analogous to the current ejb:ejb -based goals. It then becomes trivial to aggregate the calls to ejb:install and ejb:install-client from a maven.xml or other...

Attached is the patch to complete all of this.

Show
John Casey added a comment - See also: MAVEN-1068 MPARTIFACT-4 I have created a patch which works with two other patches (see MAVEN-1068 and MPARTIFACT-4) to: 1. Add ArtifactType support to the Dependency.isAddedToClasspath() method, which allows the following: <dependency> <groupId>someproject</groupId> <artifactId>someproject-ejb<artifactId> <version>1.0</version> <type>ejb-client</type> </dependency> which will result in a dependency on the EJB-client jar, not the EJB jar itself. 2. Add ArtifactType support to the DefaultArtifactDeployer.extensionForType(type) method, which will correctly allow us to use: <artifact:install-snapshot artifact="${maven.ejb.client.final.name}" type="ejb-client" project="${pom}"/> which will integrate well into the forseeable future with the artifact-orientation of maven. 3. Provide ejb:install-client, ejb:install-client-snapshot, ejb:deploy-client, and ejb:deploy-client-snapshot. This will provide EJB-client jarfile control which is fully analogous to the current ejb:ejb -based goals. It then becomes trivial to aggregate the calls to ejb:install and ejb:install-client from a maven.xml or other... Attached is the patch to complete all of this.
Hide
John Casey added a comment -

Patch to support:

ejb:install-client
ejb:install-client-snapshot
ejb:deploy-client
ejb:deploy-client-snapshot

Show
John Casey added a comment - Patch to support: ejb:install-client ejb:install-client-snapshot ejb:deploy-client ejb:deploy-client-snapshot
Hide
Tim Shadel added a comment -

This patch fixes a typo in the first patch submitted against this issue (ejb.patch, hence the name for this patch). The patch incorrectly calls ejb:client instead of ejb:ejb-client in one spot.

Show
Tim Shadel added a comment - This patch fixes a typo in the first patch submitted against this issue (ejb.patch, hence the name for this patch). The patch incorrectly calls ejb:client instead of ejb:ejb-client in one spot.
Hide
Tim Shadel added a comment -

It's very helpful to default the behavior of 'maven ejb' to build both the client and then main ejb. This issue had two competing patches. One patch relied on MAVEN-1068 and MPARTIFACT-4. Both have been closed as Won't Fix.

Please consider the original patch, ejb.patch (and the typo fix to it), now that the competing patch is no longer viable.

Show
Tim Shadel added a comment - It's very helpful to default the behavior of 'maven ejb' to build both the client and then main ejb. This issue had two competing patches. One patch relied on MAVEN-1068 and MPARTIFACT-4. Both have been closed as Won't Fix. Please consider the original patch, ejb.patch (and the typo fix to it), now that the competing patch is no longer viable.
Hide
Tim Shadel added a comment -

The EJB plugin has changed enough that part of the original patch fails. This simply updates it to work against the code for the MAVEN_EJB_1_5 tag.

Show
Tim Shadel added a comment - The EJB plugin has changed enough that part of the original patch fails. This simply updates it to work against the code for the MAVEN_EJB_1_5 tag.
Hide
Vincent Massol added a comment -

Thanks Tim. I've applied your patch. I've made quite a lot of extensive modifications though, like adding a new maven.ejb.client.generate property. Thanks!

Show
Vincent Massol added a comment - Thanks Tim. I've applied your patch. I've made quite a lot of extensive modifications though, like adding a new maven.ejb.client.generate property. Thanks!

People

Vote (8)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1d
Original Estimate - 1 day
Remaining:
1d
Remaining Estimate - 1 day
Logged:
Not Specified
Time Spent - Not Specified