Knew it needed to be something simple [my wife says things like 'male pattern blindness']
It still would be nice to have a working example for the plugin's 'examples' page. Is it possible to have a single module project? [ear file generated in the same project containing the managed bean / ejb source files]? That would be the simplest case, and would be a good fit for an archetype. [may require a new release of the ear plugin] On Tue, Mar 15, 2011 at 11:17 AM, Timothy Mcginnis <[email protected]> wrote: > You didn't specify the packaging type for the artifact. > > <packaging>ear</packaging> > > Tim McGinnis > 717 720-1962 > Web Development > AES/PHEAA > > > > From: > "Dave Levitt" <[email protected]> > To: > "Maven Users List" <[email protected]> > Date: > 03/15/2011 10:56 AM > Subject: > maven ear plugin - simple example > > > > I am having trouble using the ear plugin [version 2.5] with Maven > 3.0.3, to create an EAR file for a simple stateless ejb. > > I've tried the javaee 6 archetype from mojo - that seems to be just > for the ear module of a multi-module application - accordingly, I've > tried both single and multi module configurations but so far neither > has worked. I've tried following an example I've located at > http://agoncal.wordpress.com/2009/10/23/because-i-always-forget-how-to-use-maven-ear-plugin/ > > but I'm getting an empty ear file > > I want to create a complete example that could be added to the usage > page for the plugin. > > So, assuming that we want to package one java ee 6 Stateless Session > Bean [annotated @Stateless, one public method returning a fixed > String] like > > package org.apache.maven.example; > > import javax.ejb.Stateless; > > @Stateless > public class Foo{ > public String getTest(){ > return "test"; > } > } > > And assuming that a multi module layout is used [parent, ejb module, > ear module] what should the pom for the ear module look like? > > My [non working] example currently looks like > > <project> > <parent> > <groupId>org.apache.example<groupId> > <artifactId>jee6eartest</artifactId> > <version>1.0-SNAPSHOT<version> > </parent> > > <artifactId>fooEar</artifactId> > > <dependancies> > <dependency> > <groupId>org.apache.example<groupId> > <artifactId>fooejb</artifactId> > <version>1.0-SNAPSHOT<version> > <type>ejb</type > </dependency> > </dependancies> > > <build> > <plugins> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven.ear.plugin</artifactId> > <version>2.5</version> > <configuration> > <version>6</version> <!--- Java EE spec version???? --> > <modules> > <ejbModule> > groupId>org.apache.example<groupId> > <artifactId>fooejb</artifactId> > </ejbModule> > </modules> > </configuration> > <plugin> > </plugins> > </build> > > </project> > > When this is run, the ejb jar file is generate in its module, then > Maven builds the ear module. > > The log shows > [WARNING] JAR will be empty - no content marked for inclusion! > [INFO] Building jar: > C:\work\jee6eartest\fooEar\target\fooEar-1.0-SNAPSHOT.jar > > Does anyone have this working? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > > > > ============================================================================== > This message contains privileged and confidential information intended for > the above addressees only. If you > receive this message in error please delete or destroy this message and/or > attachments. > > The sender of this message will fully cooperate in the civil and criminal > prosecution of any individual engaging > in the unauthorized use of this message. > ============================================================================== > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
