aboutsummaryrefslogtreecommitdiff
path: root/antlr-3.4/antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml
blob: e8db11434fa2cd03ac2d6d2fa5db2869cf318229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- =======================================================================
         A quickstart pom.xml that creates a sample project that uses ANTLR 3.x
         grammars. You should replace the sample grammars in src/main/antlr3
         with your own grammar files and use packages.

         A .g file in
          
            src/main/antlr3/com/temporalwave

          belongs in the package
          
            com.temporalwave

         See http://antlr.org/antlr3-maven-plugin for more details.

         This project produces both a jar file of the project and an executeable
         jar file that contains all the dependencies so you can run it standalone.
         See below for more details.
         
         Archetype by Jim Idle (jimi@temporal-wave.com) - Oct 2009
         Report bugs to the ANTLR interest list at http://www.antlr.org

         Generated by antlr3-maven-archetype version 3.4
         =======================================================================
      -->

    <!-- This is your organizations normal group name
         such as org.antlr
         All the artifacts you create will be under this
         group id.
      -->
    <groupId>${groupId}</groupId>

    <!-- This is how maven knows your artifact
      -->
    <artifactId>${artifactId}</artifactId>

    <!-- This is the human oriented name for the package
         so you can call it anything you like
      -->
    <name>ANTLR3 project: ${package}</name>

    <!-- This is the version of YOUR project -->
    <version>${version}</version>

    <packaging>jar</packaging>
    <url>http://antlr.org</url>

    <dependencies>

        <!--
          We need to have the ANTLR runtime jar when running and compiling.
        -->
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr-runtime</artifactId>
            <version>3.4</version>
            <scope>compile</scope>
        </dependency>

    </dependencies>

  <!--

    Tell Maven which other artifacts we need in order to
    build with the ANTLR Tool. Here we also make the default
    goal be install so that you can just type mvn at the command
    line instead of mvn install. And we add the java compiler plugin
    for convenience to show how you can use 1.6 source files but
    generate 1.4 compatible .class files (as few people seem to
    know about the jsr14 target).
    -->
    <build>

        <defaultGoal>install</defaultGoal>

        <plugins>

            <plugin>

                <groupId>org.antlr</groupId>
                <artifactId>antlr3-maven-plugin</artifactId>
                <version>3.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>antlr</goal>
                        </goals>
                    </execution>
                </executions>

            </plugin>

            <!--
              Strictly speaking, we did not need to generate this for you from
              the prototype, but we use it to illustrate how you can get
              the JDK 6 Java compiler to accept 1.5 or 1.6 targeted source code
              but produce class files that are compatible with JRE 1.4. As
              Michael Caine might not say, "Not a lot of people know that!"
              -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>jsr14</target>
                    <sourceDirectory>src</sourceDirectory>
                </configuration>
            </plugin>

            <plugin>
                
                <!--

                    Build an uber-jar that is packaged with all the other dependencies,
                    such as the antlr-runtime and so on. This will be useful
                    for developers, who then do not need to download anything else or
                    remember that they need antlr.jar in their CLASSPATH and so
                    on.

                    You can delete this plugin of course and you will then
                    get a jar file with only the code generated and included
                    directly in this project. With this plugin though you will
                    find that when you build with:

                       mvn install

                    There will be an executable jar generated. You can run this
                    as:

                      java -jar ${artifactId}-${version}-jar-with-dependencies.jar demosource.dmo

                    assuming you have a file called demosource.dmo to attempt a parse.

                  -->
                <artifactId>maven-assembly-plugin</artifactId>

                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <!--

                        Specify that we want the resulting jar to be executable
                        via java -jar, which we do by modifying the manifest
                        of course.
                      -->
                    <archive>

                        <manifest>
                            <mainClass>${package}.Main</mainClass>
                        </manifest>
                    </archive>

                </configuration>

                <!--

                    We don't want to have to specifically ask for the uber jar, so we attach the
                    running of this plugin to the execution of the package life-cycle
                    phase.
                  -->
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attached</goal>
                        </goals>
                    </execution>
                </executions>

            </plugin>

        </plugins>
    </build>

</project>