~ubuntu-branches/ubuntu/wily/maven-antrun-plugin/wily

« back to all changes in this revision

Viewing changes to src/site/apt/examples/tasksAttributes.apt.vm

  • Committer: Bazaar Package Importer
  • Author(s): Miguel Landaeta
  • Date: 2011-07-19 19:38:53 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110719193853-4umqiv4uwqcbrdd0
Tags: 1.6-1
* Team upload.
* New upstream release.
* Bump Standards-Version to 3.9.2. No changes were required.
* Migrate to source package format 3.0 (quilt).
* Allow package to build twice in a row.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 ------
 
2
 Using tasks attributes
 
3
 ------
 
4
 Vincent Siveton
 
5
 ------
 
6
 September 2006
 
7
 ------
 
8
 
 
9
 ~~ Licensed to the Apache Software Foundation (ASF) under one
 
10
 ~~ or more contributor license agreements.  See the NOTICE file
 
11
 ~~ distributed with this work for additional information
 
12
 ~~ regarding copyright ownership.  The ASF licenses this file
 
13
 ~~ to you under the Apache License, Version 2.0 (the
 
14
 ~~ "License"); you may not use this file except in compliance
 
15
 ~~ with the License.  You may obtain a copy of the License at
 
16
 ~~
 
17
 ~~   http://www.apache.org/licenses/LICENSE-2.0
 
18
 ~~
 
19
 ~~ Unless required by applicable law or agreed to in writing,
 
20
 ~~ software distributed under the License is distributed on an
 
21
 ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
22
 ~~ KIND, either express or implied.  See the License for the
 
23
 ~~ specific language governing permissions and limitations
 
24
 ~~ under the License.
 
25
 
 
26
 ~~ NOTE: For help with the syntax of this file, see:
 
27
 ~~ http://maven.apache.org/doxia/references/apt-format.html
 
28
 
 
29
Using <<<\<target/\>>>> Attributes
 
30
 
 
31
 Since plugin version 1.2 you can specify attributes in the <<<\<target/\>>>> configuration to execute or not
 
32
 Ant tasks depending some conditions. For example, to skip Ant call, you could add the following:
 
33
 
 
34
------
 
35
<project>
 
36
  ...
 
37
  <build>
 
38
    <plugins>
 
39
      ...
 
40
      <plugin>
 
41
        <groupId>org.apache.maven.plugins</groupId>
 
42
        <artifactId>maven-antrun-plugin</artifactId>
 
43
        <version>${project.version}</version>
 
44
        <executions>
 
45
          <execution>
 
46
            <phase> <!-- a lifecycle phase --> </phase>
 
47
            <configuration>
 
48
 
 
49
              <target unless="maven.test.skip">
 
50
                <echo message="To skip me, just call mvn -Dmaven.test.skip=true"/>
 
51
              </target>
 
52
 
 
53
            </configuration>
 
54
            <goals>
 
55
              <goal>run</goal>
 
56
            </goals>
 
57
          </execution>
 
58
        </executions>
 
59
      </plugin>
 
60
      ...
 
61
    </plugins>
 
62
  </build>
 
63
  ...
 
64
</project>
 
65
------