Running a maven module (web) with profiles and process-resource

Hi all,

I am giving IDEA 8.0 (on MacOS, JDK6) a testdrive, so far I have been enjoying it. However, I have a question :)

My project is a maven project, consisting of many maven-modules.
One of these modules is a webapp, which I would like to run on tomcat.
In order for my my war to be built sensibly, my pom contains profiles and require me to invoke mvn process-resources.

So, I created a run config, attached the correct server and told IDEA to run the process-resources goal before doing its make. Now, in order to get a war, I configured the maven package goal to be invoked 'before run'.

IDEA keeps coming up with an error in the messages window, saying "Error: Maven: Cannot read filter"

Obviously, when I invoke maven from the command line: mvn process-resources package -P localEnv my war comes out fine.

How do I get my config correct so it works from IDEA?


Comment actions Permalink


I might know the cause now... If I select a profile in the maven profile window, IntelliJ probably tries to invoke every module with that profile, not just my webapp module.

Can anyone confirm?

Comment actions Permalink

Hi, Hans,

What do you mean by 'maven profile window'?
Anyway, the message 'Maven: Cannot read filter' occurs if a file, specified as a resource filter (in the pom.xml) cannot be found or read.
Do your module uses a resource filter?

Anton Makeev


Please sign in to leave a comment.