Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Problem with m2e and EAR resource filtering


1st issue is both a bug in m2e-wtp and in WTP : m2e-wtp doesn't set the project's deploy-name according to finalName, but even if it did, then WTP would ignore it anyway :
There *might* be some workaround depending on the reasons why you need a specific ear name deployed on the server, so it would help if you could describe your use case.

2nd issue is not implemented. Please open a JIRA issue at and attach your sample projects there.
It should be pretty straightforward to implement, now that resource filtering is done for web projects.


Fred Bricon

2011/5/12 Rafael Vanderlei <rafaelvanderlei@xxxxxxxxx>
Hi everyone.

I found what it seems to be a bug in M2Eclipse (actually perhaps there are two bugs) and I created a project (attached on the mail) to help you reproduce the error in order to fix it.

In summary, the "bugs" are:

1. M2Eclipse seems to ignore ${} to name the EAR published in the server.
2. M2Eclipse seems to ignore <filtering>true</filtering> configured in the maven-ear-plugin

PS.: I´m using Eclipse Helios, m2e-core and m2e-wtp (I know it is not the latest m2e-wtp release, but I looked at release notes of the latest version and I could not find any fixes related to these problems)

The project structure is as follows:

- m2ewtp-ear-source-filtering-bug/
--- pom.xml
--- blank-ejb-module/
------ pom.xml
------ src/main/resources/META-INF/
--------- MANIFEST.MF
--------- ejb-jar.xml
--- ear-module/
------ pom.xml
------ src/main/application/META-INF/
--------- application.xml
--------- jboss-service.xml

I created blank-ejb-module just to insert it into ear-module/src/main/application/META-INF/application.xml (just because its DTD requires a module element)

In ear-module 's pom.xml I have this:


        <my.custom.mbean.attribute.value>MBean Attribute Value</my.custom.mbean.attribute.value>




While in src/main/application/META-INF/jboss-service.xml I have this:

<?xml version="1.0" encoding="UTF-8"?>
    <mbean name="mbeanName" code="">
        <attribute name="CustomAttribute">${my.custom.mbean.attribute.value}</attribute>

When I run ' mvn package ' from CLI I have the expected behavior (Maven generates a EAR file named "EarName.ear" and changes the property ${my.custom.mbean.attribute.value} to "MBean Attribute Value".

But when I use m2e and publish to the server (JBoss in my case), Maven generates a EAR file named "ear-module.ear" and it does not change the value of ${my.custom.mbean.attribute.value}.

Below there are a few descriptions of the files I am attaching to help you understand them:

1. On the file m2ewtp-ear-source-filtering-bug.rar there is the clean Maven project (without Eclipse files, just source and pom files)

2. On the file EAR generated by Maven CLI.rar there is the result of a simple ' mvn package ' that I ran from CLI (and which is the result I would expect from m2e, but it´s failing)

3. On the file EAR generated by M2Eclipse.rar there is the failed result of a simple ' Project > Clean ' followed by ' Server > Publish ' that I ran from Eclipse (and which is the result I was not expecting, as I expected the result in file 2 described above)

So, do you guys have any idea of when this would be fixed and, in the meanwhile, do you have any workaround to this problem?

Thanks and regards,

Rafael Vanderlei.

m2e-users mailing list

"Have you tried turning it off and on again" - The IT Crowd

Back to the top