How to override maven property in command line?

I have the following plain pom running by Maven 3.0.4.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""



I am trying to override default settings in command line like this:

mvn clean package

But this this is ignored, and I get test-1.0.jar. I've tried to change another properties, like outputDirectory, directory, artifactId, but also failed.

What is the proper way to do this thing?


See Introduction to the POM

finalName is created as:


One of the solutions is to add own property:


And now try:

mvn -DfinalName=build clean package

Need Your Help

Java null String equals result

java string null equals

Please help me how does the string.equals in java work with null value? Is there some problem with exceptions?