pom.xml revision 324c4644fee44b9898524c09511bd33c3f12e2df
1<?xml version="1.0" encoding="UTF-8"?> 2<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"> 3 <modelVersion>4.0.0</modelVersion> 4 5 <!-- ======================================================================= 6 A quickstart pom.xml that creates a sample project that uses ANTLR 3.x 7 grammars. You should replace the sample grammars in src/main/antlr3 8 with your own grammar files and use packages. 9 10 A .g file in 11 12 src/main/antlr3/com/temporalwave 13 14 belongs in the package 15 16 com.temporalwave 17 18 See http://antlr.org/antlr3-maven-plugin for more details. 19 20 This project produces both a jar file of the project and an executeable 21 jar file that contains all the dependencies so you can run it standalone. 22 See below for more details. 23 24 Archetype by Jim Idle (jimi@temporal-wave.com) - Oct 2009 25 Report bugs to the ANTLR interest list at http://www.antlr.org 26 27 Generated by antlr3-maven-archetype version 3.4 28 ======================================================================= 29 --> 30 31 <!-- This is your organizations normal group name 32 such as org.antlr 33 All the artifacts you create will be under this 34 group id. 35 --> 36 <groupId>${groupId}</groupId> 37 38 <!-- This is how maven knows your artifact 39 --> 40 <artifactId>${artifactId}</artifactId> 41 42 <!-- This is the human oriented name for the package 43 so you can call it anything you like 44 --> 45 <name>ANTLR3 project: ${package}</name> 46 47 <!-- This is the version of YOUR project --> 48 <version>${version}</version> 49 50 <packaging>jar</packaging> 51 <url>http://antlr.org</url> 52 53 <dependencies> 54 55 <!-- 56 We need to have the ANTLR runtime jar when running and compiling. 57 --> 58 <dependency> 59 <groupId>org.antlr</groupId> 60 <artifactId>antlr-runtime</artifactId> 61 <version>3.4</version> 62 <scope>compile</scope> 63 </dependency> 64 65 </dependencies> 66 67 <!-- 68 69 Tell Maven which other artifacts we need in order to 70 build with the ANTLR Tool. Here we also make the default 71 goal be install so that you can just type mvn at the command 72 line instead of mvn install. And we add the java compiler plugin 73 for convenience to show how you can use 1.6 source files but 74 generate 1.4 compatible .class files (as few people seem to 75 know about the jsr14 target). 76 --> 77 <build> 78 79 <defaultGoal>install</defaultGoal> 80 81 <plugins> 82 83 <plugin> 84 85 <groupId>org.antlr</groupId> 86 <artifactId>antlr3-maven-plugin</artifactId> 87 <version>3.4</version> 88 <executions> 89 <execution> 90 <goals> 91 <goal>antlr</goal> 92 </goals> 93 </execution> 94 </executions> 95 96 </plugin> 97 98 <!-- 99 Strictly speaking, we did not need to generate this for you from 100 the prototype, but we use it to illustrate how you can get 101 the JDK 6 Java compiler to accept 1.5 or 1.6 targeted source code 102 but produce class files that are compatible with JRE 1.4. As 103 Michael Caine might not say, "Not a lot of people know that!" 104 --> 105 <plugin> 106 <artifactId>maven-compiler-plugin</artifactId> 107 <version>2.0.2</version> 108 <configuration> 109 <source>1.6</source> 110 <target>jsr14</target> 111 <sourceDirectory>src</sourceDirectory> 112 </configuration> 113 </plugin> 114 115 <plugin> 116 117 <!-- 118 119 Build an uber-jar that is packaged with all the other dependencies, 120 such as the antlr-runtime and so on. This will be useful 121 for developers, who then do not need to download anything else or 122 remember that they need antlr.jar in their CLASSPATH and so 123 on. 124 125 You can delete this plugin of course and you will then 126 get a jar file with only the code generated and included 127 directly in this project. With this plugin though you will 128 find that when you build with: 129 130 mvn install 131 132 There will be an executable jar generated. You can run this 133 as: 134 135 java -jar ${artifactId}-${version}-jar-with-dependencies.jar demosource.dmo 136 137 assuming you have a file called demosource.dmo to attempt a parse. 138 139 --> 140 <artifactId>maven-assembly-plugin</artifactId> 141 142 <configuration> 143 <descriptorRefs> 144 <descriptorRef>jar-with-dependencies</descriptorRef> 145 </descriptorRefs> 146 <!-- 147 148 Specify that we want the resulting jar to be executable 149 via java -jar, which we do by modifying the manifest 150 of course. 151 --> 152 <archive> 153 154 <manifest> 155 <mainClass>${package}.Main</mainClass> 156 </manifest> 157 </archive> 158 159 </configuration> 160 161 <!-- 162 163 We don't want to have to specifically ask for the uber jar, so we attach the 164 running of this plugin to the execution of the package life-cycle 165 phase. 166 --> 167 <executions> 168 <execution> 169 <id>make-assembly</id> 170 <phase>package</phase> 171 <goals> 172 <goal>attached</goal> 173 </goals> 174 </execution> 175 </executions> 176 177 </plugin> 178 179 </plugins> 180 </build> 181 182</project> 183