I need to know what is the difference between these two commands which do almost same thing if we execute this command.
2 Answers
Maven doesn't assign any special meaning to release-build. However, projects can use properties (-Dproperty-name=value or just -Dproperty-name) to activate profiles that change the way the project is built (Maven - activate profile based on project property). It's likely to enable some extra steps that are only necessary for final releases. For example, this project uses it to include a native library in the build:
<profile>
    <id>native</id>
    <activation>
        <property>
            <name>release-build</name>
        </property>
    </activation>
    <modules>
        <module>pi4j-native</module>
    </modules>
</profile>
There's no general answer: you'll need to consult the documentation, or build, of the project you're working with.
You can do this much more simpler automatically to activate a profile in case of a release simply via the maven-release-plugin which already supports that out-of-the-box like this:
  <plugin>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.4.2</version>
    <configuration>
      <releaseProfiles>release</releaseProfiles>
    </configuration>
  </plugin>
Apart from that it's really bad to acitvate a module only in case of a profile is active. This will lead so several problem.
- 92,914
 - 28
 - 189
 - 235