|
|
@ -1,4 +1,4 @@ |
|
|
# Learning Jenkins, 03-01: Install Jenkins as a Container |
|
|
|
|
|
|
|
|
# Learning Jenkins, 03-01: Using a global build tool |
|
|
|
|
|
|
|
|
# Prerequisites |
|
|
# Prerequisites |
|
|
You will need to configure Maven as a global build tool. |
|
|
You will need to configure Maven as a global build tool. |
|
|
@ -16,15 +16,26 @@ Create a freestyle job and configure it as follows: |
|
|
``` |
|
|
``` |
|
|
https://github.com/managedkaos/apache-maven-hello-world |
|
|
https://github.com/managedkaos/apache-maven-hello-world |
|
|
``` |
|
|
``` |
|
|
2. *MAKE SURE TO SET THE `Branch Specifier` to `*/main`*. |
|
|
|
|
|
|
|
|
2. **MAKE SURE TO SET THE `Branch Specifier` to `*/main`**. |
|
|
3. Add a build step using `Invoke Top-Level Maven Target`. |
|
|
3. Add a build step using `Invoke Top-Level Maven Target`. |
|
|
4. For the goal, enter `package`. |
|
|
|
|
|
5. Add a build step to run the compiled package: |
|
|
|
|
|
- *FOR WINDOWS*: Use the `Execute Windows batch command` build step |
|
|
|
|
|
- FOR macOS, Linux, and Docker: Use the `Execute shell` build step |
|
|
|
|
|
6. Enter the following command: |
|
|
|
|
|
|
|
|
4. Select the Maven version you configured in the previous step. |
|
|
|
|
|
5. For the goal, enter `package`. |
|
|
|
|
|
|
|
|
|
|
|
# WINDOWS SYSTEMS |
|
|
|
|
|
Select the `Execute Windows batch command` build step |
|
|
|
|
|
``` |
|
|
|
|
|
java -cp target/hello-1.0-SNAPSHOT.jar com.learningjenkins.App |
|
|
|
|
|
``` |
|
|
|
|
|
Save the job and start the build. |
|
|
|
|
|
|
|
|
|
|
|
[Follow this link for more details on Windows](WINDOWS.md) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# MacOS, Linux, and Docker |
|
|
|
|
|
Select the `Execute shell` build step. |
|
|
``` |
|
|
``` |
|
|
java -cp target/hello-1.0-SNAPSHOT.jar com.learningjenkins.App |
|
|
java -cp target/hello-1.0-SNAPSHOT.jar com.learningjenkins.App |
|
|
``` |
|
|
``` |
|
|
7. Save the job and start a build. |
|
|
|
|
|
|
|
|
Save the job and start the build. |
|
|
|
|
|
|
|
|
|
|
|
[Follow this link for more details on MacOS, Linux, and Docker](MAC_LINUX_DOCKER.md) |