0

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.

3 comments

Please sign in to leave a comment.