İlkay Gunel
İlkay Gunel

Reputation: 852

Maven compiled class with -f command not in war file

In my project I have several pom.xml files. For a module, I must get the war file with -f command like this

mvn clean install -f pom-example.xml

But when I run this command, only a few classes don't get added to the war file.

If I run

mvn clean install

I see that the classes are there in the war file.

What is the problem? Why are these compiled classes not in the war file when I run -f command?

Upvotes: 0

Views: 41

Answers (1)

Essex Boy
Essex Boy

Reputation: 7958

This uses pom-example.xml

mvn clean install -f pom-example.xml

This uses pom.xml

mvn clean install

I think it's confusing have 2 pom files in the same directory, if you want different behavior I would use profiles and one pom see http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Upvotes: 1

Related Questions