Maven 2.x EJB Plugin

outputDirectory is not created before packaging

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

When using the jar plugin, outputDirectory is being cerated prior to creating the jar.

The ejb plugin however fails if specifying an outputDirectory which does not exist -

So, specifying something like ${project.build.directory}/jar will always fail after a clean.

Activity

Hide
Dennis Lundberg added a comment -

Can you give us a complete pom.xml that we can use to test this?

Show
Dennis Lundberg added a comment - Can you give us a complete pom.xml that we can use to test this?
Hide
Dennis Lundberg added a comment -

I had a look at this and I get the following error message:

Error assembling EJB: META-INF/ejb-jar.xml is required for ejbVersion 2.x

Here's the configuration snippet I used:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ejb-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <outputDirectory>${project.build.directory}/jar</outputDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>

The reason for the error is that the EJB Plugin searches for resources (in this case the exb-jar.xml) in <outputDirectory>. But the file is not there. It is in the outputDirectory specified for the Resources Plugin. This needs to be rewritten in order to fix this issue.

Show
Dennis Lundberg added a comment - I had a look at this and I get the following error message:
Error assembling EJB: META-INF/ejb-jar.xml is required for ejbVersion 2.x
Here's the configuration snippet I used:
<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ejb-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <outputDirectory>${project.build.directory}/jar</outputDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
The reason for the error is that the EJB Plugin searches for resources (in this case the exb-jar.xml) in <outputDirectory>. But the file is not there. It is in the outputDirectory specified for the Resources Plugin. This needs to be rewritten in order to fix this issue.
Hide
Adam Barry added a comment -

The reason I am voting for this issue is to be able to use the outputDirectory of an ejb module much like an exploded war where JBoss for instance requires the exploded directory to have an appropriate extension ie:
ejbmodule/target/ejbmodule-exploded.jar/

Show
Adam Barry added a comment - The reason I am voting for this issue is to be able to use the outputDirectory of an ejb module much like an exploded war where JBoss for instance requires the exploded directory to have an appropriate extension ie: ejbmodule/target/ejbmodule-exploded.jar/
Hide
Adam Barry added a comment - - edited

As a workaround I used the following antrun plugin task:

<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <executions>
    <execution>
      <phase>process-classes</phase>
      <configuration>
        <tasks>
          <copydir src="${project.build.outputDirectory}"
                   dest="${project.build.directory}/${project.build.finalName}-exploded.jar"/>
        </tasks>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>
Show
Adam Barry added a comment - - edited As a workaround I used the following antrun plugin task:
<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <executions>
    <execution>
      <phase>process-classes</phase>
      <configuration>
        <tasks>
          <copydir src="${project.build.outputDirectory}"
                   dest="${project.build.directory}/${project.build.finalName}-exploded.jar"/>
        </tasks>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated: