I'm currently developing an OSGi based application (using Felix). In this project, there are bundles depending on other bundles. In the past we were using Ant script to compile and build everything, and now we want to mavenize this, however the task is not trivial at all.
Here is the folder structure I have:
+-shared
-- pom.xml
-- someProject
--- pom.xml
-- org.apache.felix
--- pom.xml
-- org.apache.activemq
--- pom.xml
-- org.apache.log4j
--- pom.xml
-- org.snake.yaml
--- pom.xml
-- ...
Obviously, the root POM is supposed to build everything here, and the individual POMs simply describe the bundles. I also have MANIFEST.MF files in each bundle (not auto-generated). I must say that we don't want to get the stuff from the common repository, but rather to have our own local one.
Right now, I am not using any plugin like maven-bundle-plugin and I am trying to do this myself. However I get a lot of errors, which are mostly package does not exist errors. Therefore I suspect I am doing something wrong. After looking around in the forum, I noticed that a lot of people have been using the maven-bundle-plugin, so I also started to consider to do so. However, the official website could help me only until a certain point, then I got stuck.
So long story short, I'd like to have a functional pom.xml which can at least compile. It may also generate the MANIFEST.MF automatically, would be nice, however, I am not sure how should I proceed.
So far I came up with this pom.xml (of someProject1):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>shared</groupId>
<artifactId>shared.master</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>shared</groupId>
<artifactId>shared.cmd.felix</artifactId>
<name>shared.cmd.felix</name>
<version>1.0.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>shared</groupId>
<artifactId>org.apache.felix</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.apache.felix/felix.jar</systemPath>
</dependency>
<dependency>
<groupId>shared</groupId>
<artifactId>org.apache.log4j</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.apache.log4j/log4j-1.2.17.jar</systemPath>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Export-Package>shared.cmd.felix</Export-Package>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
and pom.xml of org.apache.felix:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>shared</groupId>
<artifactId>shared.master</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>shared</groupId>
<artifactId>org.apache.felix</artifactId>
<name>org.apache.felix</name>
<version>1.0.0</version>
</project>
and the MANIFEST.MF I have is:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Shared Felix Console Extension
Bundle-SymbolicName: shared.cmd.felix
Bundle-Version: 1.0.0
Fragment-Host: shared.mw;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: .,
bundle/system/org.apache.felix.gogo.runtime-0.10.0.jar
Export-Package: shared.cmd.ext
Import-Package: shared,
shared.cmd,
shared.comp,
shared.mw,
shared.sched,
shared.service,
org.apache.felix.service.command,
org.apache.log4j,
org.osgi.framework
Require-Bundle: org.apache.felix;bundle-version="1.0.0",
org.apache.activemq
however, I get errors like:
[ERROR] /shared/shared.cmd.felix/src/shared/cmd/ext/ListScheduledTasks.java:[11,40] package org.apache.felix.service.command does not exist
[ERROR] /shared/shared.cmd.felix/src/shared/cmd/ext/ListScheduledTasks.java:[15,19] cannot find symbol
Now, if I want to change this to a state which can utilize maven-bundle-plugin, how could it be? I came up with this, but don't know if this corresponds to the one I have above:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>shared</groupId>
<artifactId>shared.cmd.felix</artifactId>
<packaging>bundle</packaging>
<name>shared.cmd.felix</name>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>org.apache.felix</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
<artifactId>org.apache.log4j</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>${pom.groupId}</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>--WHAT TO PUT HERE?--</Export-Package>
<Private-Package>--WHAT TO PUT HERE?-</Private-Package>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Activator>--WHAT TO PUT HERE?-</Bundle-Activator>
<Export-Service>--WHAT TO PUT HERE?-</Export-Service>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
and more importantly, do I need to insert everything there? Can't I skip some of those, such as Export-Service? And what happened to the local paths that I was entering above, why doesn't the plugin have these? Does it automatically find them or?
Could someone help me out with this? I would appreciate any contribution.
Thanks in advance.
Assuming you are using bnd-maven-plugin, you don't add dependencies at all in your bnd.bnd file. You only add them in pom.xml in the standard Maven way. Follow any standard Maven tutorial for this.
If you are getting errors from the Java compiler about unknown packages, then it just means you have missed a build dependency in pom.xml.
Given your starting point I think it would be easiest to begin building your project as a plain Java project... don't worry about OSGi at all yet! This will make sure that you have all the compile-time dependencies you need, and again you can use any standard Maven tutorial if you get stuck.
Once you have a plain Java project that actually builds, then you can add in the bnd-maven-plugin in order to turn your JARs into bundles.
Full disclosure: I am the original author of the bnd-maven-plugin.
It is very difficult to do all the package imports and exports by hand. Even if you achieve it the code will be very brittle as you would have to adapt to all refactorings. If you then also want to do the package uses clauses by hand you are totally screwed.
I have used the maven-bundle-plugin as well as the bnd-maven-plugin. Both work great. If you project is designed well then you will not need much config at all.
The tasklist-ds example shows how to apply this to a complete tree of bundles.
I configure the maven-bundle-plugin only in the parent pom. The actual config is done in bnd.bnd files that are imported.
You can start by keeping them empty. Then look at the bundles that are generated. You can then tune the imports and export but try to keep those special configs to a minimum.
Related
I am using Maven in order to automatically download a dependency, set up (and start) the JBoss server and deploy that downloaded dependency there. I created a pom.xml, which uses several Maven-Plugins. For JBoss-related interactions I am using the wildfly-maven.plugin (currently version 2.0.1.Final).
Since I am not building an artifact, but rather downloading it, I am not really producing a JAR (or any archived artifact).
The problem I currently have is: the wildfly-maven-plugin does not seem to do anything if packaging is set to pom.
As a workaround I currently set the project packaging to JAR and added the following to prevent the project JAR from building:
<properties>
<jar.skipIfEmpty>true</jar.skipIfEmpty>
<maven.install.skip>true</maven.install.skip>
</properties>
Update 04.03
This is what my pom.xml basically looks like:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>some.group</groupId>
<artifactId>artifact</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>~y</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.install.skip>true</maven.install.skip>
<jar.skipIfEmpty>true</jar.skipIfEmpty>
<plugin.wildfly.version>2.0.1.Final</plugin.wildfly.version>
<plugin.wildfly.jboss-home>D:\server\jboss-eap-7.1</plugin.wildfly.jboss-home>
<plugin.wildfly.hostname>localhost</plugin.wildfly.hostname>
<plugin.wildfly.port>9990</plugin.wildfly.port>
<plugin.wildfly.debug.port>9991</plugin.wildfly.debug.port>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${plugin.wildfly.version}</version>
<configuration>
<jboss-home>${plugin.wildfly.jboss-home}</jboss-home>
<id>local-jboss</id>
<hostname>${plugin.wildfly.hostname}</hostname>
<port>${plugin.wildfly.port}</port>
<filename>y.ear</filename>
<force>true</force>
</configuration>
<executions>
<execution>
<id>deploy-ear</id>
<phase>install</phase>
<goals>
<goal>deploy-only</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I will give deploy-artifact a try, but in general I'd expect the wildfly.maven.plugin to work even if <packaging> is set to pom.
Maven command on commandline to build it: mvn clean install.
My real pom.xml is a bit more complex, but if it'd work using this simple pom.xml, I could make it work in the more complex one that I use.
Have a look at the deploy-artifact goal. There is an example of it in the documentation.
wildfly-maven-plugin does not seem to do anything if packaging is set to pom. Using the packaging-type jar along with jar.skipIfEmpty helps.
When using wildfly-maven-plugin's deploy-only goal, publishing works (through the management interface).
I am trying to create a runnale openliberty server as part of my release process. I have a a multi module maven project with a submodule dedicated to packaging the server as a runnable. When I do a mvn clean package a lovely executable jar is produced which bundles one of the other submodules (war). The problem I am facing is when I do a maven deploy to our asset repo the packaged server is being uploaded as a zip file rather than a jar file. Does anyone know how to get the deploy plugin to upload the jar?
Here is a sample pom file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>au.com.xxxx.xxxx</groupId>
<artifactId>xxx-backend-parent</artifactId>
<version>0.0.16-SNAPSHOT</version>
</parent>
<artifactId>xxxx-openliberty-server</artifactId>
<packaging>liberty-assembly</packaging>
<name>fusion-openliberty-server</name>
<description>Runnable Jar containing xxxxand the OpenLiberty applictaion server</description>
<dependencies>
<!-- Package xxxx-application.war with server assembly -->
<dependency>
<groupId>au.com.xxx.xxx</groupId>
<artifactId>xxxx-application</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Enable liberty-maven-plugin -->
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>2.6.1</version>
<extensions>true</extensions>
<configuration>
<assemblyArtifact>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-javaee8</artifactId>
<version>18.0.0.3</version>
<type>zip</type>
</assemblyArtifact>
<include>runnable</include>
<serverName>xxx</serverName>
<appsDirectory>apps</appsDirectory>
<serverEnv>${basedir}/src/main/resources/server.env</serverEnv>
<configFile>${basedir}/src/main/resources/server.xml</configFile>
<jvmOptionsFile>${basedir}/src/main/resources/jvm.options</jvmOptionsFile>
<bootstrapProperties>
<app.context.root>xxx-app</app.context.root>
<default.http.port>5000</default.http.port>
<default.https.port>5443</default.https.port>
</bootstrapProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>
I don't have an answer to your question but an explanation why this happens. Every packaging type (jar, war, liberty-assembly) defines a fixed extension for the artifact(s) it creates. The liberty-assembly types defines zip as it extension. This extension is used by the maven-install-plugin and maven-deploy-plugin regardless how the local file is names. I did quite some code digging but couldn't find a way to change this. It's probably sth. that only liberty-maven-plugin can change/fix.
I want to package one EAR that will be deployed on GlassFish Server Open Source Edition.
Here are the relevant parts of the pom.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
....
<packaging>ear</packaging>
<dependencies>
....
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>/lib</defaultLibBundleDir>
</configuration>
</plugin>
</plugins>
</build>
</project>
I usually run mvn compile and mvn package in the command terminal. The resulting EAR has the following structure.
EAR/lib/*.jar
EAR/META-INF/application.xml
EAR/META-INF/META-INF.MF
EAR/META-INF/maven/...
The application.xml is
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
<display-name>test-app</display-name>
<library-directory>/lib</library-directory>
</application>
If I try to run asadmin deploy test-app.ear to deploy the EAR to GlassFish I get this error.
remote failure: Error occurred during deployment: org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 22; Deployment descriptor file META-INF/application.xml in archive ....
Here I rename application.xml to glassfish-application.xml and change its content to
<!DOCTYPE glassfish-application PUBLIC "-//GlassFish.org//DTD
GlassFish Application Server 3.1 Java EE Application 6.0//EN"
"http://glassfish.org/dtds/glassfish-application_6_0-1.dtd">
<glassfish-application>
<unique-id>67488732739338240</unique-id>
</glassfish-application>
If I rerun asadmin deploy test-app.ear GlassFish recognizes the deployment descriptor but throws the next error that says Application [test-app] contains no valid components.
Here I move all jars from EAR/lib/*.jar to EAR/META-INF/lib/*.jar.
If I now rerun asadmin deploy test-app.ear GlassFish recognizes the EAR as valid and deploys it.
Since I dont want to manually change the EAR every time. How can I configure Maven to
1. Output a valid application.xml or glassfish-application.xml
2. Copy the dependencies not to EAR/lib/ but to EAR/META-INF/lib (if it is really necessary)
Thanks in advance.
How can I configure Maven to
Output a valid application.xml or glassfish-application.xml
Copy the dependencies not to EAR/lib/ but to EAR/META-INF/lib (if it is really necessary)
application.xml can be autogenerated by maven-ejb-plugin and for the simple test I would leave it up to plugin
for dependencies copying - it depends what you package in your ear (can be war/jar/...) but in general, it's a good idea, to let maven do it. For the purpose you miss in your pom.xml sections that would refer to modules (war/jar/...) you want to be included in there
moreover I don't see a reason for non-standard libs folder you specified with: <library-directory>
So I'd go for config like the sample present here.
To include the relevant sections in answer:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<version>6</version>
<modules>
<webModule>
<groupId>com.mycompany</groupId>
<artifactId>myWar</artifactId>
<bundleFileName>myWarNameInTheEar.war</bundleFileName>
<contextRoot>/myWarConext</contextRoot>
</webModule>
<ejbModule>
<groupId>com.mycompany</groupId>
<artifactId>myEjb</artifactId>
<bundleFileName>myEjbNameInTheEar.jar</bundleFileName>
</ejbModule>
</modules>
<displayName>My Ear Name displayed in the App Server</displayName>
<generateApplicationXml>true</generateApplicationXml>
</configuration>
</plugin>
</plugins>
</build>
<!-- Define the versions of your ear components here -->
<dependencies>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>myWar</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>myEjb</artifactId>
<version>1.0-SNAPSHOT</version>
<type>ejb</type>
</dependency>
</dependencies>
Please note you need to specify dependencies - for modules, but include those in modules section as well, to have them packaged.
Feel free to ask in case of any further questions.
I got a simple maven project and yet frustratingly fail for hours to get it right. The project contains 1 parent module, and 2 submodules (one for ear-packaging, the other for an ejb). Building works successfully, but the ear-packing just doesn't work as expected:
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>at.betrieb.projekt</groupId>
<artifactId>extended</artifactId>
<version>1.0</version>
</parent>
<artifactId>extended-ear</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>at.betrieb.projekt</groupId>
<artifactId>extended-ejb</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.7</version>
<configuration>
<version>6</version>
<generateApplicationXml>false</generateApplicationXml>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<jarModule>
<groupId>at.betrieb.projekt</groupId>
<artifactId>extended-ejb</artifactId>
<bundleDir>/</bundleDir>
</jarModule>
</configuration>
</plugin>
</plugins>
</build>
</project>
Now when I look into the packaged folder I see this structure:
|-lib
extended-ejb-1.0.jar
activation-1.1.jar
javaee-api-7.0.jar
javax.mail-1.5.0.jar
|-META-INF
application.xml
What I expected however was this structure:
|-extended-ejb-1.0.jar
|-lib
activation-1.1.jar
javaee-api-7.0.jar
javax.mail-1.5.0.jar
|-META-INF
application.xml
So basically I wanted the ejb outside of the other libraries. These other 3 libraries come from the ejb-module which requires the javaee-api dependency for annotations. Unfortunately it also collects transitive the javax.mail.jar, activation.jar.
Now I really don't know why the structure just doesn't work as expected, by all means I tried to follow this guide step by step.
Ok, after I checked out a project from various maven archetypes I found the error... the minimal error... it's always a minimal error costing huge amounts of time...
In the dependencies section of the ear file, where I define my ejb as dependency, just add this:
<type>ejb</type>
so it's:
<dependency>
<groupId>at.betrieb.projekt</groupId>
<artifactId>extended-ejb</artifactId>
<version>1.0</version>
<type>ejb</type>
</dependency>
Afterwards it works correctly. Obviously it is wrong on the IBM page and on many other pages. Besides I found out the following section is also outdated, and can be completely removed from the ear-plugin section:
<jarModule>
<groupId>at.betrieb.projekt</groupId>
<artifactId>extended-ejb</artifactId>
<bundleDir>/</bundleDir>
</jarModule>
I'm facing a problem with maven build. I have several ejb projects. After maven build the jar-file contains the maven descriptor in META-INF/maven twice, i.e. if I extract files to disk 7zip asks to overwrite files although extracted to a new folder. If a specify <addMavenDescriptor>false</addMavenDescriptor> in the archive-tag of the ejb plugin then the maven decriptor is still generated but only once. Is there another place where I can disable maven descriptor generation or does anybody know the reason for the duplicate generation?
Maven version is: 3.0.3
Project structure is like:
-pom
-ejb
Here is the pom.xml of the EJB module:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>TestMavenDescriptors</artifactId>
<groupId>de.test</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>TestEJB</artifactId>
<packaging>ejb</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Here is the pom.xml of the parent project.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.test</groupId>
<artifactId>TestMavenDescriptors</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>TestEJB</module>
</modules>
</project>
I found out that this is a problem special to eclipse version (I have RAD 8 trial) and possibily of the m2e plugin version. The above behavior (duplicate generation of maven descriptors) occurs only if I have the EJB project in my workspace added. That means if I remove the EJB project from workspace (without deleting contents on disk) such that only the hierarchal parent maven project (pom packaged) is existing in the workspace (which contains the EJB project but EJB project is then not known to eclipse) then everything works fine. Strange, isn't it?!
BTW: on current eclipse (java ee package) this doesn't occur, all fine there.