diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml b/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml index ab0c74c52fdff6a7e15a2624181ece47a4cad9f1..e19c1510cd3e236aefb9660ac781822cd2ee73b8 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml @@ -5,7 +5,7 @@ <groupId>de.hdm_stuttgart.mi</groupId> <artifactId>mi-maven-archetype-quickstart</artifactId> - <version>2.1</version> + <version>2.2</version> <packaging>maven-archetype</packaging> @@ -45,16 +45,23 @@ </plugin> </plugins> </pluginManagement> + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> - <version>3.2.0</version> - <configuration> + <version>3.3.0</version> + <configuration> <!-- Required so that .gitignore gets included in archetypes; see https://issues.apache.org/jira/browse/MRESOURCES-190 --> <addDefaultExcludes>false</addDefaultExcludes> - </configuration> - </plugin> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>3.0.0</version> + </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/Readme.md b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/Readme.md index bce99a2e27e3bdb7d6a22992066e3a472543f569..d2070e8e4b18cafc72721819ff6cf019deec1560 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/Readme.md +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/Readme.md @@ -1,15 +1,77 @@ -Java project template -==================== +# Java project template + +## General: -General: --------- This archetype is based on the -[Maven Quickstart Archetype » 1.1](https://mvnrepository.com/artifact/org.apache.maven.archetypes/maven-archetype-quickstart/1.1) +[Maven Archetype Quickstart ](https://mvnrepository.com/artifact/org.apache.maven.archetypes/maven-archetype-quickstart/1.4) providing the following updates / enhancements: * Updated [JUnit » 4.x](https://mvnrepository.com/artifact/junit/junit) version. * [Apache Log4j Core » 2.x](https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core) -* [Apache Maven Compiler Plugin » 3.x](https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin) - setting project's Java 15+ language level. +* [Apache Maven Compiler Plugin » 3.x](https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin) + setting Java 15 language level. * [Apache Maven Javadoc Plugin » 3.x](https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin) * [Apache Maven Shade Plugin » 3.x](https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin) + +## Prerequisites + +This archetype is available from [HdM / MI](https://maven.mi.hdm-stuttgart.de) to Maven by configuring +a file `~/.m2/settings.xml` with `~` denoting your home folder: + +``` +<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> + + <profiles> + <profile> + <id>development</id> + <repositories> + <repository> + <id>archetypeMI</id> + <name>Supplementary MI archetypes and artifacts</name> + <url>https://maven.mi.hdm-stuttgart.de/nexus/repository/mi-maven</url> + <releases><enabled>true</enabled></releases> + <snapshots><enabled>true</enabled></snapshots> + </repository> + </repositories> + </profile> + </profiles> + + <activeProfiles> + <activeProfile>development</activeProfile> + </activeProfiles> + +</settings> +``` +Caution to Windows users: Creating `settings.xml` might result in actually creating `settings.xml.txt` +due to Microsoft's infameous default »Hide extensions for known file types« setting. You are strongly +advised to [turn this off](https://www.thewindowsclub.com/show-file-extensions-in-windows). + +## Usage + +Create an new project: + +``` +mvn --batch-mode -e archetype:generate -DgroupId=de.hdm_stuttgart.mi.sd1 \ + -DartifactId=first -Dversion=0.9 -DarchetypeGroupId=de.hdm_stuttgart.mi \ + -DarchetypeArtifactId=mi-maven-archetype-quickstart -DarchetypeVersion=2.2 +``` + +## Details + +Three sample classes and one corresponding Junit test class are being provided: + +### `App.java` and `AppTest.java` + +Featuring a Junit test and logging by log4j. + +### HighlightSample.java + +Featuring [highlight.js](https://highlightjs.org) for code highlighting being configured in the`pom.xml` +section `maven-javadoc-plugin`. + +### Statistics.java + +Demonstrating LaTeX based formulas to be rendered by [MathJax](https://www.mathjax.org) being configured +in the `pom.xml` section `maven-javadoc-plugin`. \ No newline at end of file diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml index c1f11952a12fdd1f822262dca0bb9fc859cc48f1..6ddbc2ac3cd2dabc02c565a312d6c48c49be7df8 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml @@ -30,7 +30,7 @@ <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.18.0</version> + <version>2.19.0</version> </dependency> </dependencies> @@ -47,7 +47,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>3.4.0</version> + <version>3.4.1</version> <configuration> <linksource>true</linksource> <detectJavaApiLink>false</detectJavaApiLink> @@ -70,7 +70,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> - <version>3.3.0</version> + <version>3.4.1</version> <configuration> <transformers> <transformer @@ -88,13 +88,24 @@ <goals> <goal>shade</goal> </goals> + <!-- Avoiding 'overlapping resources' problems --> + <configuration> + <filters> + <filter> + <artifact>org.apache.logging.log4j:*</artifact> + <excludes> + <exclude>META-INF/*</exclude> + </excludes> + </filter> + </filters> + </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> - <version>3.12.0</version> + <version>3.12.1</version> </plugin> </plugins> </build>