70 lines
2.0 KiB
Org Mode
Executable File
70 lines
2.0 KiB
Org Mode
Executable File
:PROPERTIES:
|
|
:ID: bcd41e87-120c-455c-8898-996ddaa41f75
|
|
:END:
|
|
#+title: maven-pom-file
|
|
#+filetags: :guide:java:
|
|
|
|
* Doc Link
|
|
- [[https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html][Link to apache doc]]
|
|
|
|
* Example of pom.xml
|
|
#+begin_src xml
|
|
|
|
<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/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<groupId>com.mycompany.app</groupId>
|
|
<artifactId>my-app</artifactId>
|
|
<version>1.0-SNAPSHOT</version>
|
|
<name>my-app</name>
|
|
<!-- FIXME change it to the project's website -->
|
|
<url>http://www.example.com</url>
|
|
<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<maven.compiler.release>17</maven.compiler.release>
|
|
</properties>
|
|
<dependencyManagement>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>org.junit</groupId>
|
|
<artifactId>junit-bom</artifactId>
|
|
<version>5.11.0</version>
|
|
<type>pom</type>
|
|
<scope>import</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
</dependencyManagement>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter-api</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<!-- Optionally: parameterized tests support -->
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter-params</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
<build>
|
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
|
... lots of helpful plugins
|
|
</pluginManagement>
|
|
</build>
|
|
</project>
|
|
|
|
#+end_src
|
|
|
|
* Commands:
|
|
|
|
*FOR TESTING*
|
|
#+begin_src bash
|
|
mvn clean test
|
|
#+end_src
|
|
|
|
*COMPILING*
|
|
#+begin_src bash
|
|
mvn compile
|
|
#+end_src
|