mirror of https://github.com/apache/maven.git
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293442 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
83f92aa8ea
commit
71f15ae92d
|
@ -129,7 +129,8 @@ m2 archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
|
|||
* <<packaging>> This element indicates the packing to be used by this artifact. This not only means if the artifact
|
||||
produced is JAR, WAR, or EAR but can also indicate a specific lifecycle to use as part of the build process. This
|
||||
is a topic we will deal with further on in the guide, just keep in mind the indicated packaging of a project
|
||||
can play a part in customizing the build lifecycle.
|
||||
can play a part in customizing the build lifecycle. The default value for the <<<packaging>>> element is JAR
|
||||
so you do not have to specify this for most projects.
|
||||
|
||||
* <<version>> This element indicates the version of the artifact generated by the project. Maven goes a long way
|
||||
to help you with version management and you will often see the <<<SNAPSHOT>>> designator in a version which
|
||||
|
@ -285,7 +286,25 @@ Results :
|
|||
|
||||
* How do I create a JAR and install it in my local repository?
|
||||
|
||||
Making a JAR file is straight forward enough and can be accomplished by executing the following command:
|
||||
|
||||
+----+
|
||||
|
||||
m2 package
|
||||
|
||||
+----+
|
||||
|
||||
If you again take a look at the POM for this project you will notice the <<<packaging>>> element is set to <<<jar>>>.
|
||||
This is how Maven knows to produce a JAR file from the above command. You can now take a look in the the
|
||||
<<<${basedir}/target>>> directory and you will see the generated JAR file.
|
||||
|
||||
+----+
|
||||
|
||||
m2 install
|
||||
|
||||
+----+
|
||||
|
||||
|
||||
+----+
|
||||
|
||||
~~* How do I package resources inside my JAR?
|
||||
|
@ -295,8 +314,6 @@ Results :
|
|||
|
||||
~~* How do I filter resources against my POM?
|
||||
|
||||
+-----+
|
||||
|
||||
FYI - In beta-2, while the other technique is still supported, the
|
||||
recommended way is finally settled:
|
||||
|
||||
|
@ -308,8 +325,6 @@ chatting with emm in irc and src/main/filters seems like a good place for filter
|
|||
</filters>
|
||||
</build>
|
||||
|
||||
+-----+
|
||||
|
||||
~~* How do use resources with my tests?
|
||||
~~ o EIDSL
|
||||
|
||||
|
|
Loading…
Reference in New Issue