Issue 16 in seam-maven-refimpl: Create separate EAR POM projects for JBoss 4, 5, 6

0 views
Skip to first unread message

seam-mave...@googlecode.com

unread,
Feb 2, 2011, 9:48:31 AM2/2/11
to seam-mave...@googlegroups.com
Status: Accepted
Owner: leif.o.o...@gmail.com
Labels: Type-Enhancement Priority-Medium

New issue 16 by leif.o.o...@gmail.com: Create separate EAR POM projects for
JBoss 4, 5, 6
http://code.google.com/p/seam-maven-refimpl/issues/detail?id=16

What steps will reproduce the problem?

Goal:
Migrate to Maven3

Problem:
Maven3 does not evaluate external properties during
the "ear:generate-application-xml" goal.
see: http://jira.codehaus.org/browse/MNG-2971

Description:
In projects with more than one developer each developer often has her/his
own
requirements regarding how to set up the development environment: The
targeted
application server is different, e.g. JBoos-4.3 vs JBoss-5, and the
database
connection url is different for each developer - etc, etc.

Targeting different environments often involves affecting properties in
the
project POMs. With this requirement we can not use Maven filters to read
properties into the POM; they are ony visible to resources and can not be
accessed inside the POM.

This is where the Properties Maven Plugin makes our life a little easier
when
dealing with properties that we need to access inside our POM. It
provides goals
to read and write properties from and to files, and also to set system
properties.
It's main use-case is loading properties from files instead of declaring
them in
pom.xml, something that comes in handy when dealing with different
environments.
The plugin read properties during the "initialize" phase and the
properties are
then accessible from the pom.

The use-case above works perfectly in Maven2 and the
ear:generate-application-xml
goal creates the jboss-app.xml.

In Maven3 we'll get the following error message:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-ear-plugin:2.4.2:generate-application-xml
(default-generate-application-xml) on project mvn3-problem-ear: Failed
to in
itialize JBoss configuration: Invalid JBoss configuration,
version[${as.version}]
is not supported. -> [Help 1]

If we put the ${as.version} property placeholder inside Maven's property
tag
everything works ok in Maven3.

Solution:
Create separate EAR POM projects for JBoss 4, 5, 6


Fady Matar

unread,
Feb 2, 2011, 9:50:18 AM2/2/11
to seam-mave...@googlegroups.com
The maven-ear-plugin causing this issue has been updated, I will test that feature and get back to you



--
You received this message because you are subscribed to the Google Groups "Know IT_SeamInAction" group.
To post to this group, send email to seam-mave...@googlegroups.com.
To unsubscribe from this group, send email to seam-maven-refi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seam-maven-refimpl?hl=en.


Leif Olsen

unread,
Feb 2, 2011, 11:46:37 AM2/2/11
to seam-mave...@googlegroups.com
Maybe an EAR project per appserver could be a nice idea anyway. Using profiles to target a specific appserver can be a challenging task. Mr. Bjarte S Karlsen tipped me about this blog, http://blog.tfnico.com/2011/01/maven-build-helper-poms.html. According to this blog overuse of profiles are "POM smell".

/Leif
--
/Leif

seam-mave...@googlecode.com

unread,
Feb 7, 2011, 10:38:42 AM2/7/11
to seam-mave...@googlegroups.com

Comment #1 on issue 16 by fady.ma...@gmail.com: Create separate EAR POM

To avoid creating separate EARs why don't we create seperate profiles in
the ear pom.xml and each profile will override the as.version manually e.g.

<profile>
<id>jboss-4</jboss-4>
<properties>
<as.version>4</as.version>
</properties>
</profile>

<profile>
<id>jboss-5</id>
<properties>
<as.version>5</as.version>
</properties>
</profile>

<profile>
<id>jboss-6</id>
<properties>
<as.version>6</as.version>
</properties>
</profile>

Wouldn't that be a simpler solution?

seam-mave...@googlecode.com

unread,
Feb 7, 2011, 11:12:42 AM2/7/11
to seam-mave...@googlegroups.com

Comment #2 on issue 16 by fady.ma...@gmail.com: Create separate EAR POM

I think my comment has some errors there, first of all the maven-ear-plugin
doesn't support version 6 of JBoss AS (at least not yet) so the same
profile could be used for JBoss AS versions 5 and 6.

Another property that should be added is the ds.xml since it's not filtered
either by the plugin

seam-mave...@googlecode.com

unread,
Feb 7, 2011, 11:16:51 AM2/7/11
to seam-mave...@googlegroups.com

Comment #3 on issue 16 by fady.ma...@gmail.com: Create separate EAR POM

I guess the separate profiles is inevitable. One alternative is to either
hardcode the properties there or create multiple profiles for different
application servers, not a very elegant way of doing this but until the
maven-ear-plugin can filter resources we're bound to that approach

Leif Olsen

unread,
Feb 7, 2011, 2:05:37 PM2/7/11
to seam-mave...@googlegroups.com
The problen is a M3 bug,  see: http://jira.codehaus.org/browse/MNG-2971
Guess we have to wait until bug is fixed. 

--
You received this message because you are subscribed to the Google Groups "Know IT_SeamInAction" group.
To post to this group, send email to seam-mave...@googlegroups.com.
To unsubscribe from this group, send email to seam-maven-refi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seam-maven-refimpl?hl=en.




--
/Leif
Reply all
Reply to author
Forward
0 new messages