mirror of https://github.com/apache/maven.git
o change m2 references to mvn
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@326378 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9f85534aee
commit
d2f955f34c
|
@ -64,7 +64,7 @@ Download Maven 2.0
|
|||
[[3]] In the same dialog, make sure that <<<JAVA_HOME>>> is set to the location of your JDK,
|
||||
eg. <<<C:\Program Files\Java\jdk1.5.0_02>>>
|
||||
|
||||
[[4]] Run <<<m2 --version>>> to verify that it is correctly installed.
|
||||
[[4]] Run <<<mvn --version>>> to verify that it is correctly installed.
|
||||
|
||||
** Unix-based Operating Systems (Linux, Solaris and Mac OS X)
|
||||
|
||||
|
@ -77,5 +77,5 @@ Download Maven 2.0
|
|||
[[3]] Make sure that <<<JAVA_HOME>>> is set to the location of your JDK, eg.
|
||||
<<<export JAVA_HOME=/usr/java/jdk1.5.0_02>>>
|
||||
|
||||
[[4]] Run <<<m2 --version>>> to verify that it is correctly installed.
|
||||
[[4]] Run <<<mvn --version>>> to verify that it is correctly installed.
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ Sections
|
|||
|
||||
+-----+
|
||||
|
||||
m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
|
||||
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
|
||||
|
||||
+-----+
|
||||
|
||||
|
@ -227,7 +227,7 @@ my-app
|
|||
|
||||
+-----+
|
||||
|
||||
m2 compile
|
||||
mvn compile
|
||||
|
||||
+-----+
|
||||
|
||||
|
@ -281,7 +281,7 @@ Compiling 1 source file to <dir>/my-app/target/classes
|
|||
|
||||
+----+
|
||||
|
||||
m2 test
|
||||
mvn test
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -335,7 +335,7 @@ Results :
|
|||
|
||||
+----+
|
||||
|
||||
m2 test-compile
|
||||
mvn test-compile
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -350,7 +350,7 @@ Results :
|
|||
|
||||
+----+
|
||||
|
||||
m2 package
|
||||
mvn package
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -365,7 +365,7 @@ m2 package
|
|||
|
||||
+----+
|
||||
|
||||
m2 install
|
||||
mvn install
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -444,7 +444,7 @@ Results :
|
|||
|
||||
+----+
|
||||
|
||||
m2 site
|
||||
mvn site
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -639,7 +639,7 @@ application.version=${pom.version}
|
|||
|
||||
+----+
|
||||
|
||||
m2 process-resources
|
||||
mvn process-resources
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -710,7 +710,7 @@ message=${my.filter.value}
|
|||
|
||||
+----+
|
||||
|
||||
the next execution of the <<<m2 process-resources>>> command will put our new property value into application.properties.
|
||||
the next execution of the <<<mvn process-resources>>> command will put our new property value into application.properties.
|
||||
As an alternative to defining the my.filter.value property in an external file, you could also have defined it in the <<<properties>>>
|
||||
section of your pom.xml and you'd get the same effect (notice I don't need the references to src/main/filters/filter.properties either):
|
||||
|
||||
|
@ -765,7 +765,7 @@ command.line.prop=${command.line.prop}
|
|||
|
||||
+----+
|
||||
|
||||
m2 process-resources "-Dcommand.line.prop=hello again"
|
||||
mvn process-resources "-Dcommand.line.prop=hello again"
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -912,7 +912,7 @@ m2 process-resources "-Dcommand.line.prop=hello again"
|
|||
|
||||
+----+
|
||||
|
||||
Now, when we compile the project (<<<m2 compile>>>), we'll see Maven download the log4j dependency for us.
|
||||
Now, when we compile the project (<<<mvn compile>>>), we'll see Maven download the log4j dependency for us.
|
||||
|
||||
~~DJ: Current
|
||||
|
||||
|
@ -996,7 +996,7 @@ m2 process-resources "-Dcommand.line.prop=hello again"
|
|||
|
||||
+----+
|
||||
|
||||
m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-site
|
||||
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-site
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -1070,7 +1070,7 @@ my-app
|
|||
Generating the site is very simple, and fast!
|
||||
|
||||
---------------
|
||||
m2 site
|
||||
mvn site
|
||||
---------------
|
||||
|
||||
The resulting site will be in <<<target/site/...>>>
|
||||
|
@ -1097,7 +1097,7 @@ m2 site
|
|||
You must presently run the <<<site:site>>> goal independantly.
|
||||
|
||||
---------------
|
||||
m2 site-deploy
|
||||
mvn site-deploy
|
||||
---------------
|
||||
|
||||
<<Note:>> the trailing slash in the URL above indicates that any subprojects that inherit this value should append their artifact ID to
|
||||
|
|
|
@ -67,7 +67,7 @@ Introduction to Plugin Prefix Resolution
|
|||
from the model:
|
||||
|
||||
+---+
|
||||
m2 -Dversion=4.0.0 -Dmodel=maven.mdo modello:java
|
||||
mvn -Dversion=4.0.0 -Dmodel=maven.mdo modello:java
|
||||
+---+
|
||||
|
||||
Adding <<org.codehaus.modello>> to the list of groupIds searched for plugin
|
||||
|
|
|
@ -45,7 +45,7 @@ Introduction to Maven 2.0 Plugin Development
|
|||
One of the simplest plugins in Maven 2.0 is the Clean Plugin. The
|
||||
{{{http://maven.apache.org/maven2/plugins/maven-clean-plugin/}Maven
|
||||
Clean plugin}} (maven-clean-plugin) is responsible for removing the target
|
||||
directory of a Maven 2 project. When you run "m2 clean:clean", Maven 2 executes
|
||||
directory of a Maven 2 project. When you run "mvn clean:clean", Maven 2 executes
|
||||
the "clean:clean" goal as defined in the Clean plug-in, and the target directory
|
||||
is removed. The Clean plugin
|
||||
{{{http://maven.apache.org/maven2/plugins/maven-clean-plugin/clean-mojo.html}defines
|
||||
|
|
|
@ -288,13 +288,13 @@ Introduction to Build Profiles
|
|||
system properties contain "env=dev". So, executing:
|
||||
|
||||
+---+
|
||||
m2 -Denv=dev integration-test
|
||||
mvn -Denv=dev integration-test
|
||||
+---+
|
||||
|
||||
should result in a successful build. However, this won't:
|
||||
|
||||
+---+
|
||||
m2 -Denv=production integration-test
|
||||
mvn -Denv=production integration-test
|
||||
+---+
|
||||
|
||||
Why? Because, the resulting non-interpolated literal value of $\{appserver.home\}
|
||||
|
@ -334,7 +334,7 @@ m2 -Denv=production integration-test
|
|||
you need to activate <<env-test>> by issuing:
|
||||
|
||||
+---+
|
||||
m2 -Denv=test <phase>
|
||||
mvn -Denv=test <phase>
|
||||
+---+
|
||||
|
||||
The right command-line option can be had by simply substituting "=" for "-" in
|
||||
|
@ -348,7 +348,7 @@ m2 -Denv=test <phase>
|
|||
To see the list of active profiles, issue:
|
||||
|
||||
+---+
|
||||
m2 projecthelp:active-profiles -Denv=test
|
||||
mvn projecthelp:active-profiles -Denv=test
|
||||
+---+
|
||||
|
||||
This should render a bulleted list of the profiles (hopefully including one
|
||||
|
@ -358,7 +358,7 @@ m2 projecthelp:active-profiles -Denv=test
|
|||
POM, issue:
|
||||
|
||||
+---+
|
||||
m2 projecthelp:effective-pom -Denv=test
|
||||
mvn projecthelp:effective-pom -Denv=test
|
||||
+---+
|
||||
|
||||
This will print the effective POM for this build configuration out to the
|
||||
|
|
|
@ -99,7 +99,7 @@ Introduction to Repositories
|
|||
|
||||
+---+
|
||||
|
||||
m2 -o package
|
||||
mvn -o package
|
||||
|
||||
+---+
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ Introduction to the Build Lifecycle
|
|||
you desire on the command line. For example:
|
||||
|
||||
-------
|
||||
m2 install
|
||||
mvn install
|
||||
-------
|
||||
|
||||
This command will compile, test, package, verify and install the package into the local repository when run.
|
||||
|
@ -51,7 +51,7 @@ m2 install
|
|||
It should also be noted that the same command can be used in a multi-module scenario. For example;
|
||||
|
||||
------
|
||||
m2 clean:clean install
|
||||
mvn clean:clean install
|
||||
------
|
||||
|
||||
This command will traverse into all of the subprojects and run <<<clean:clean>>>, then <<<install>>> (including all of
|
||||
|
|
|
@ -29,10 +29,10 @@ you declare profile in your pom like this :
|
|||
</profile>
|
||||
</profiles>
|
||||
|
||||
and you can run m2 with one of profiles like :
|
||||
m2 -P env-production clean:clean install ==> we use the profile id
|
||||
and you can run mvn with one of profiles like :
|
||||
mvn -P env-production clean:clean install ==> we use the profile id
|
||||
or
|
||||
m2 -Denv=test clean:clean install ==> we use the property env define in
|
||||
mvn -Denv=test clean:clean install ==> we use the property env define in
|
||||
<activation>
|
||||
|
||||
Emmanuel
|
||||
|
|
|
@ -142,7 +142,7 @@ Guide to creating assemblies
|
|||
|
||||
+----+
|
||||
|
||||
m2 assembly:assembly
|
||||
mvn assembly:assembly
|
||||
|
||||
+----+
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ Guide to using attached tests
|
|||
|
||||
+----+
|
||||
|
||||
m2 install
|
||||
mvn install
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -53,7 +53,7 @@ m2 install
|
|||
|
||||
+----+
|
||||
|
||||
m2 deploy
|
||||
mvn deploy
|
||||
|
||||
+----+
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ _m2_complete()
|
|||
COMPREPLY=($(compgen -W "${goals}" ${cur} | sed 's/\\\\//g') )
|
||||
}
|
||||
|
||||
complete -F _m2_complete -o filenames m2
|
||||
complete -F _m2_complete -o filenames mvn
|
||||
|
||||
+----+
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ Coping with SUN JARs
|
|||
|
||||
+----+
|
||||
|
||||
m2 install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
|
||||
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
|
||||
-DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
|
||||
|
||||
+----+
|
||||
|
|
|
@ -56,7 +56,7 @@ archetype
|
|||
|
||||
+----+
|
||||
|
||||
m2 install
|
||||
mvn install
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -64,7 +64,7 @@ m2 install
|
|||
|
||||
+----+
|
||||
|
||||
m2 archetype:create -DgroupId=com.mycompany.app \
|
||||
mvn archetype:create -DgroupId=com.mycompany.app \
|
||||
-DartifactId=my-archetype -DarchetypeGroupId=<artifact-group-id> -DarchetypeArtifactId=<archetype-artifact-id>
|
||||
|
||||
+----+
|
||||
|
|
|
@ -88,6 +88,6 @@ Guide to deploying with FTP
|
|||
|
||||
+----+
|
||||
|
||||
m2 deploy
|
||||
mvn deploy
|
||||
|
||||
+----+
|
|
@ -67,6 +67,6 @@ Guide to deploying with an external SSH command
|
|||
|
||||
+----+
|
||||
|
||||
m2 deploy
|
||||
mvn deploy
|
||||
|
||||
+----+
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
+----+
|
||||
|
||||
m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-ear
|
||||
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-ear
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -39,7 +39,7 @@ m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -Darchety
|
|||
|
||||
+----+
|
||||
|
||||
m2 clean package
|
||||
mvn clean package
|
||||
|
||||
+----+
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ Guide to generating sources
|
|||
|
||||
+----+
|
||||
|
||||
If you then type "m2 compile" m2 will walk through the {{{../introduction/introduction-to-the-lifecycle.html}lifecycle}}
|
||||
If you then type "mvn compile" m2 will walk through the {{{../introduction/introduction-to-the-lifecycle.html}lifecycle}}
|
||||
and will eventually hit the <<<generate-sources>>> phase and see you have a plugin configured that
|
||||
wants to participate in that phase and the antlr plugin is executed with
|
||||
your given configuration.
|
||||
|
|
|
@ -12,6 +12,6 @@ Guide to using Eclipse with Maven 2.x
|
|||
|
||||
+----+
|
||||
|
||||
m2 eclipse:eclipse
|
||||
mvn eclipse:eclipse
|
||||
|
||||
+----+
|
||||
|
|
|
@ -12,6 +12,6 @@ Guide to using IDEA with Maven 2.x
|
|||
|
||||
+----+
|
||||
|
||||
m2 idea:idea
|
||||
mvn idea:idea
|
||||
|
||||
+----+
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
------
|
||||
Guide to Using maven 2 in Netbeans 4.0 (4.1 and 5.0)
|
||||
------
|
||||
Raphaël Piéroni
|
||||
Rapha<EFBFBD>l Pi<50>roni
|
||||
------
|
||||
Mon Aug 9 2005
|
||||
------
|
||||
|
@ -34,7 +34,7 @@ Using maven 2 in Netbeans 4.0 (4.1 and 5.0)
|
|||
You can also checkout the Maven 2 project using your versionning system.
|
||||
|
||||
-------------------
|
||||
[maven-user@mini-guide examples]$ m2 archetype:create -DarchetypeArtifactId=maven-archetype-quickstart -DartifactId=demoquickstart -DgroupId=demoquickstart
|
||||
[maven-user@mini-guide examples]$ mvn archetype:create -DarchetypeArtifactId=maven-archetype-quickstart -DartifactId=demoquickstart -DgroupId=demoquickstart
|
||||
|
||||
[INFO] Searching repository for plugin with prefix: 'archetype'.
|
||||
[INFO] ----------------------------------------------------------------------------
|
||||
|
@ -107,7 +107,7 @@ Using maven 2 in Netbeans 4.0 (4.1 and 5.0)
|
|||
To eneable the project, use the netbeans-freeform plugin for Maven 2.
|
||||
|
||||
-------------------
|
||||
[maven-user@mini-guide demoquickstart]$ m2 netbeans-freeform:generate-netbeans-project
|
||||
[maven-user@mini-guide demoquickstart]$ mvn netbeans-freeform:generate-netbeans-project
|
||||
[INFO] Searching repository for plugin with prefix: 'netbeans-freeform'.
|
||||
[INFO] ----------------------------------------------------------------------------
|
||||
[INFO] Building Maven Quick Start Archetype
|
||||
|
|
|
@ -78,7 +78,7 @@ Setting up Multiple Repositories
|
|||
|
||||
+----+
|
||||
|
||||
m2 -Pmyprofile ...
|
||||
mvn -Pmyprofile ...
|
||||
|
||||
+----+
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Preparing the release
|
|||
[]
|
||||
|
||||
-----
|
||||
m2 release:prepare -DtagBase=svn+ssh://svn.codehaus.org/home/projects/plexus/scm/tags
|
||||
mvn release:prepare -DtagBase=svn+ssh://svn.codehaus.org/home/projects/plexus/scm/tags
|
||||
-----
|
||||
|
||||
When this operation is over, your source control has the released code tagged and ready to deploy.
|
||||
|
@ -42,7 +42,7 @@ m2 release:prepare -DtagBase=svn+ssh://svn.codehaus.org/home/projects/plexus/scm
|
|||
Performing the release
|
||||
|
||||
-----
|
||||
m2 release:perform -DtagBase=svn+ssh://svn.codehaus.org/home/projects/plexus/scm
|
||||
mvn release:perform -DtagBase=svn+ssh://svn.codehaus.org/home/projects/plexus/scm
|
||||
-----
|
||||
|
||||
~~ -----
|
||||
|
|
|
@ -49,7 +49,7 @@ Creating a site
|
|||
Generating the site is very simple, and fast!
|
||||
|
||||
---------------
|
||||
m2 site:site
|
||||
mvn site:site
|
||||
---------------
|
||||
|
||||
The resulting site will be in <<<target/site/...>>>
|
||||
|
@ -78,7 +78,7 @@ m2 site:site
|
|||
You must presently run the <<<site:site>>> goal as well.
|
||||
|
||||
---------------
|
||||
m2 site:site site:deploy
|
||||
mvn site:site site:deploy
|
||||
---------------
|
||||
|
||||
<<Note:>> the trailing slash in the URL above indicates that any subprojects that inherit this value should append their artifact ID to
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
+----+
|
||||
|
||||
m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
|
||||
mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
|
||||
|
||||
+----+
|
||||
|
||||
|
@ -39,7 +39,7 @@ m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp -Darchety
|
|||
|
||||
+----+
|
||||
|
||||
m2 clean:clean package
|
||||
mvn clean:clean package
|
||||
|
||||
+----+
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ groupID:artifactID:version:goal
|
|||
+----+
|
||||
|
||||
For example, to run the simple mojo in the sample plugin, you would enter
|
||||
"<<<m2 sample.plugin:maven-hello-plugin:1.0-SNAPSHOT:sayhi>>>" on the
|
||||
"<<<mvn sample.plugin:maven-hello-plugin:1.0-SNAPSHOT:sayhi>>>" on the
|
||||
command line.
|
||||
|
||||
*** Shortening the Command Line
|
||||
|
@ -172,7 +172,7 @@ groupID:artifactID:version:goal
|
|||
<<<updateReleaseInfo>>> option set to true; for example:
|
||||
|
||||
+----+
|
||||
m2 -DupdateReleaseInfo=true install
|
||||
mvn -DupdateReleaseInfo=true install
|
||||
+----+
|
||||
|
||||
You also need to add your plugin's group ID to the list of group IDs
|
||||
|
@ -185,7 +185,7 @@ m2 -DupdateReleaseInfo=true install
|
|||
</pluginGroups>
|
||||
+----+
|
||||
|
||||
At this point, you can run the mojo with "<<<m2 hello:sayhi>>>".
|
||||
At this point, you can run the mojo with "<<<mvn hello:sayhi>>>".
|
||||
|
||||
|
||||
*** Attaching the Mojo to the Build Lifecycle
|
||||
|
|
|
@ -68,7 +68,7 @@ artifact project.
|
|||
3. I ran the install phase as follows:
|
||||
|
||||
> cd com/acme
|
||||
> m2 install
|
||||
> mvn install
|
||||
|
||||
which caused the target directories to be generated also at the same
|
||||
level as each pom - for example com/acme/util/target and com/acme/gui/
|
||||
|
@ -90,7 +90,7 @@ com/acme/gui/Main.class
|
|||
gui.properties
|
||||
META-INF/maven/com.acme/gui/pom.properties
|
||||
|
||||
which looks fine. I also ran "m2 site:site" as a random goal and that
|
||||
which looks fine. I also ran "mvn site:site" as a random goal and that
|
||||
seemed to work too, ie a target/site directory was created with all
|
||||
the files correctly generated underneath.
|
||||
|
||||
|
|
Loading…
Reference in New Issue