|
1 |
| -JavaParser and Maven sample |
| 1 | +JavaParser and Gradle sample |
2 | 2 | ---
|
3 | 3 |
|
4 |
| -A fully working sample Maven project that parses and generates code with [JavaParser](http://www.javaparser.org) |
| 4 | +A fully working sample Gradle project that parses and generates code with [JavaParser](http://www.javaparser.org) |
5 | 5 |
|
6 |
| -This is targeted at people without [Maven](https://maven.apache.org/) experience. |
| 6 | +This is targeted at people without [Gradle](https://gradle.org/) experience. |
| 7 | + |
| 8 | +To build it, you will need to download and unpack the latest (or recent) version of Gradle (https://gradle.org/install/) |
| 9 | +and put the `gradle` command on your path. Alternatively, you can use the (included) gradle wrapper. |
7 | 10 |
|
8 |
| -To build it, you will need to download and unpack the latest (or recent) version of Maven (https://maven.apache.org/download.cgi) |
9 |
| -and put the `mvn` command on your path. |
10 | 11 | Then, you will need to install a Java 1.8 (or higher) JDK (not JRE!), and make sure you can run `java` from the command line.
|
11 |
| -Now you can run `mvn clean install` and Maven will compile your project, |
12 |
| -an put the results it in two jar files in the `target` directory. |
13 |
| -If you like to run from the command line, |
14 |
| -execute `java -jar target/javaparser-maven-sample-1.0-SNAPSHOT-shaded.jar`. |
15 | 12 |
|
16 |
| -How you run this code is up to you, but usually you would start by using an IDE like [NetBeans](https://netbeans.org/), [Intellij IDEA](https://www.jetbrains.com/idea/), or [Eclipse](https://eclipse.org/ide/). |
| 13 | +Now you can run `gradle shadowJar` - Gradle will compile your project and put the |
| 14 | + resulting jar file in the `build` directory. |
| 15 | + |
| 16 | +If you like to run from the command line, execute |
| 17 | +`java -jar build/libs/javaparser-gradle-sample-shadow-1.0-SNAPSHOT-beta.jar`. |
| 18 | + |
| 19 | +How you run this code is up to you, but usually you would start by using an IDE |
| 20 | +like [NetBeans](https://netbeans.org/), [Intellij IDEA](https://www.jetbrains.com/idea/), |
| 21 | +or [Eclipse](https://eclipse.org/ide/). |
17 | 22 |
|
18 |
| -The Maven dependencies may lag behind the official releases a bit. |
| 23 | +Note that the JavaParser dependencies may lag behind the official releases a bit. |
19 | 24 |
|
20 | 25 | If you notice some problems with this setup, please open an issue.
|
0 commit comments