Return-Path: X-Original-To: apmail-maven-commits-archive@www.apache.org Delivered-To: apmail-maven-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7355D10149 for ; Fri, 2 Aug 2013 13:41:15 +0000 (UTC) Received: (qmail 23233 invoked by uid 500); 2 Aug 2013 13:41:15 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 23035 invoked by uid 500); 2 Aug 2013 13:41:14 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 23020 invoked by uid 99); 2 Aug 2013 13:41:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Aug 2013 13:41:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Aug 2013 13:41:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 96D322388860; Fri, 2 Aug 2013 13:40:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1509706 - /maven/site/trunk/content/apt/guides/getting-started/index.apt Date: Fri, 02 Aug 2013 13:40:51 -0000 To: commits@maven.apache.org From: hboutemy@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130802134051.96D322388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hboutemy Date: Fri Aug 2 13:40:51 2013 New Revision: 1509706 URL: http://svn.apache.org/r1509706 Log: little improvements Modified: maven/site/trunk/content/apt/guides/getting-started/index.apt Modified: maven/site/trunk/content/apt/guides/getting-started/index.apt URL: http://svn.apache.org/viewvc/maven/site/trunk/content/apt/guides/getting-started/index.apt?rev=1509706&r1=1509705&r2=1509706&view=diff ============================================================================== --- maven/site/trunk/content/apt/guides/getting-started/index.apt (original) +++ maven/site/trunk/content/apt/guides/getting-started/index.apt Fri Aug 2 13:40:51 2013 @@ -192,7 +192,7 @@ mvn archetype:generate \ [] - For a complete reference of what elements are available for use in the POM please refer to our {{{../../maven-model/maven.html}POM Reference}}. + For a complete reference of what elements are available for use in the POM please refer to our {{{/ref/current/maven-model/maven.html}POM Reference}}. Now let's get back to the project at hand. After the archetype generation of your first project you will also notice that the following directory structure @@ -225,7 +225,7 @@ my-app Maven convention and to learn more about it you can read our {{{../introduction/introduction-to-the-standard-directory-layout.html}Introduction to the Standard Directory Layout}}. - Now that we have a POM, some application sources, and some test sources you are probably asking ... + Now that we have a POM, some application sources, and some test sources you are probably asking... * {How do I compile my application sources?} @@ -263,14 +263,14 @@ Compiling 1 source file to /my-app/ +-----+ The first time you execute this (or any other) command, Maven will need to download all the plugins and related - dependencies it needs to fulfill the command. From a clean installation of Maven this can take quite a while (in + dependencies it needs to fulfill the command. From a clean installation of Maven, this can take quite a while (in the output above, it took almost 4 minutes). If you execute the command again, Maven will now have what it needs, so it won't need to download anything new and will be able to execute the command much more quickly. As you can see from the output, the compiled classes were placed in <<<$\{basedir\}/target/classes>>>, which is another standard convention employed by Maven. So, if you're a keen observer, you'll notice that by using the - standard conventions the POM above is very small and you haven't had to tell Maven explicitly where any of - your sources are or where the output should go. By following the standard Maven conventions you can get + standard conventions, the POM above is very small and you haven't had to tell Maven explicitly where any of + your sources are or where the output should go. By following the standard Maven conventions, you can get a lot done with very little effort! Just as a casual comparison, let's take a look at what you might have had to do in {{{http://ant.apache.org}Ant}} to accomplish the same {{{../../ant/build-a1.xml}thing}}. @@ -675,15 +675,15 @@ InputStream is = getClass().getResourceA to add this to our pom.xml in order to override that default value and set <<>> to true. To reference a property defined in your pom.xml, the property name uses the names of the XML elements that define the value, - with "pom" being allowed as an alias for the project (root) element. So $\{pom.name\} refers to the name of the project, - $\{pom.version\} refers to the version of the project, $\{pom.build.finalName\} refers to the final name of the file created + with "pom" being allowed as an alias for the project (root) element. So <<<$\{pom.name\}>>> refers to the name of the project, + <<<$\{pom.version\}>>> refers to the version of the project, <<<$\{pom.build.finalName\}>>> refers to the final name of the file created when the built project is packaged, etc. Note that some elements of the POM have default values, so don't need to be explicitly - defined in your pom.xml for the values to be available here. Similarly, values in the user's settings.xml can be referenced - using property names beginning with "settings" (for example, $\{settings.localRepository\} refers to the path of the user's + defined in your <<>> for the values to be available here. Similarly, values in the user's <<>> can be referenced + using property names beginning with "settings" (for example, <<<$\{settings.localRepository\}>>> refers to the path of the user's local repository). - To continue our example, let's add a couple of properties to the application.properties file (which we put in the - src/main/resources directory) whose values will be supplied when the resource is filtered: + To continue our example, let's add a couple of properties to the <<>> file (which we put in the + <<>> directory) whose values will be supplied when the resource is filtered: +----+ # application.properties @@ -698,7 +698,7 @@ application.version=${pom.version} mvn process-resources +----+ - and the application.properties file under target/classes (and will eventually go into the jar) looks like this: + and the <<>> file under <<>> (and will eventually go into the jar) looks like this: +----+ # application.properties @@ -707,14 +707,14 @@ application.version=1.0-SNAPSHOT +----+ To reference a property defined in an external file, all you need to do is add a reference to this external file in your pom.xml. - First, let's create our external properties file and call it src/main/filters/filter.properties: + First, let's create our external properties file and call it <<>>: +----+ # filter.properties my.filter.value=hello! +----+ - Next, we'll add a reference to this new file in the pom.xml: + Next, we'll add a reference to this new file in the <<>>: +----+ +----+ - Then, if we add a reference to this property in the application.properties file: + Then, if we add a reference to this property in the <<>> file: +----+ # application.properties @@ -765,7 +765,7 @@ message=${my.filter.value} the next execution of the <<>> command will put our new property value into <<>>. As an alternative to defining the my.filter.value property in an external file, you could also have defined it in the <<>> - section of your pom.xml and you'd get the same effect (notice I don't need the references to <<>> either): + section of your <<>> and you'd get the same effect (notice I don't need the references to <<>> either): +----+ +----+ - Filtering resources can also get values from system properties; either the system properties built into Java (like java.version or - user.home) or properties defined on the command line using the standard Java -D parameter. To continue the example, let's change - our application.properties file to look like this: + Filtering resources can also get values from system properties; either the system properties built into Java (like <<>> or + <<>>) or properties defined on the command line using the standard Java -D parameter. To continue the example, let's change + our <<>> file to look like this: +----+ # application.properties @@ -817,7 +817,7 @@ command.line.prop=${command.line.prop} +----+ Now, when you execute the following command (note the definition of the command.line.prop property on the command line), the - application.properties file will contain the values from the system properties. + <<>> file will contain the values from the system properties. +----+ mvn process-resources "-Dcommand.line.prop=hello again" @@ -862,9 +862,9 @@ mvn process-resources "-Dcommand.line.pr +----+ For each external dependency, you'll need to define at least 4 things: groupId, artifactId, version, and scope. The groupId, - artifactId, and version are the same as those given in the pom.xml for the project that built that dependency. The scope + artifactId, and version are the same as those given in the <<>> for the project that built that dependency. The scope element indicates how your project uses that dependency, and can be values like <<>>, <<>>, and <<>>. - For more information on everything you can specify for a dependency, see the {{{../../../maven-model/maven.html}Project Descriptor Reference}}. + For more information on everything you can specify for a dependency, see the {{{/ref/current/maven-model/maven.html}Project Descriptor Reference}}. ~~DJ: Does this link work? I can't find the document. For more information about the dependency mechanism as a whole, see {{{../introduction/introduction-to-dependency-mechanism.html}Introduction to Dependency Mechanism}}.