Saltuk Kezer
Saltuk Kezer

Reputation: 135

Maven file and profile at the same time not working?

I'm trying to execute a maven command like the following:

mvn clean install -f ../<some-path>/pom.xml -Pear -DskipTests

For some reason this command is not working correctly. The profile is not getting applied. What is the problem here?

Upvotes: 0

Views: 94

Answers (2)

Saltuk Kezer
Saltuk Kezer

Reputation: 135

cd ..
call mvn -DskipTests -Pear clean install
cd <some-path>

I did it like this now and it works. Thanks for @Adriaan Koster for the hint with the relative poms. That seems to have been it. And maybe i should use absolute paths instead :)

Upvotes: 0

Adriaan Koster
Adriaan Koster

Reputation: 16209

I think maybe -f doesn't work as you think it does. See this answer: How to run Maven from another directory (without cd to project dir)?

If your project uses relative pom locations, this breaks.

See also: https://maven.apache.org/plugin-developers/common-bugs.html#Resolving_Relative_Paths

Upvotes: 1

Related Questions