Hello,

I lost couple of hours with this problem, so I am giving the solution (and
would like to hear the better one, if there is a such).

The problem:

We have ear with couple of modules (ejb, war...) and META-INF with standard
and proprietary descriptors (data-sources.xml, orion-application.xml, etc.).
Some of them need to be filtered (for example: data-sources.xml).

In order to `mvn package` on the ear artifact generate desired structure, we
have to put our descriptors in the ${basedir}/src/main/application (not in
${basedir}/src/main/resources).

And that works. But filtering doesn't! If we set filtering on this folder,
in the target we get classes folder with properly filtered resources, but
the ear is not using them. Ear uses your-ear-artifact in the target to be
made of. In the target/your-ear-artifact there is META-INF, but with non
filtered resources.

The quickest (and only one for now, as I know) solution:

We have to tell ear plugin to use ${basedir}/target/classes  as the resource
folder, since there are located properly filtered resources:

<plugin>
   <artifactId>maven-ear-plugin</artifactId>
      <configuration>
         <resourcesDir>target/classes</resourcesDir>
      </configuration>
</plugin>

Ofcourse, we are using now the standard ${basedir}/src/main/resources folder
with filtering turned on.

Regards,
Vanja

Reply via email to