This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
3 Replies Last post: May 16, 2013 6:12 PM by Sergey Evdokimov  
Boris Skrynnik Newbie 2 posts since
May 15, 2013
Currently Being Moderated

May 15, 2013 4:56 PM

Maven ear plugin filtering problem

I have multimodule maven project (root, ear, ejb, web and java) with glassfish. And i'm trying to use filtering for deployment descriptors.

 

Project structure (here is only files where i'm trying to apply filtering option)

  • root
    • ear
      • src/main/application/META-INF/glassfish-resources.xml
    • ejb
      • src/main/resources/META-INF/persistence.xml
    • java
    • web

 

In ejb module filtering option in pom.xml is following:

 

<resources>
    <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
            <include>**/*.xml</include>
        </includes>
    </resource>
</resources>

 

and in ear module i'm using built-in filtering tag in maven ear plugin:

 

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.8</version>
    <configuration>
        <filtering>true</filtering>
        ...
    </configuration>
</plugin>

 

So the problem is when i compiling project via maven - filtering works great for both modules, but when i run it via Intellij Idea (build 129.451) - persistence.xml (ejb module) filters great, but glassfish-resources.xml (ear module) don't.

 

I've figured out that problem in ear-exploded artifact (ear module) - in javaeeapplication facet there is no deployment descriptor glassfish-resources.xml, only application.xml. But i can't add glassfish-resources.xml to javaeeapplication facet as non-static file.

Sergey Evdokimov Novice 174 posts since
May 11, 2010
Currently Being Moderated
May 15, 2013 6:56 PM in response to: Boris Skrynnik
Re: Maven ear plugin filtering problem
Sergey Evdokimov Novice 174 posts since
May 11, 2010
Currently Being Moderated
May 16, 2013 6:13 PM in response to: Boris Skrynnik
Re: Maven ear plugin filtering problem

Yes, create another issue, please.

Yes, it's impossible to to filter resources ear/war plugin now.

More Like This

  • Retrieving data ...