diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml b/ws/Archetypes/mi-maven-archetype-quickstart/pom.xml index 0adf45687e30d03cf84d9a26d8035322008d032a..24f6ed2bf10e223c96d564c831b4a0b014d6f65a 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>1.6</version> + <version>1.7</version> <packaging>maven-archetype</packaging> 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 2370778a46763e353d11c298dd342b7c5a369fd9..50f8f59ad865e7dc9a8575a372f18d90ee92fa89 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 @@ -15,8 +15,8 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.7</maven.compiler.source> - <maven.compiler.target>1.7</maven.compiler.target> + <maven.compiler.source>11</maven.compiler.source> + <maven.compiler.target>11</maven.compiler.target> </properties> <dependencies> @@ -50,9 +50,19 @@ <version>3.2.0</version> <configuration> <linksource>true</linksource> + <detectJavaApiLink>false</detectJavaApiLink> <additionalOptions> - <additionalOption>-html5</additionalOption> + <additionalOption>-html5 --allow-script-in-comments</additionalOption> </additionalOptions> + <nohelp>true</nohelp> + + <header><![CDATA[ + <script type="text/javascript" + src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.5.0/build/styles/idea.min.css"> + <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.5.0/build/highlight.js"></script> + <script type="text/javascript">hljs.initHighlightingOnLoad();</script>]]> + </header> <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> </configuration> </plugin> diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/HighlightSample.java b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/HighlightSample.java new file mode 100644 index 0000000000000000000000000000000000000000..a2efba26d1ced5b5204ccf3f2f947fa43d03391f --- /dev/null +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/HighlightSample.java @@ -0,0 +1,52 @@ +package $package; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +/** + * <p>The sole purpose of this class is about demonstrating + * <a target="_blank" href="https://highlightjs.org">highlight.js</a> syntax highlighting support in Javadoc.</p> + * + */ +public class HighlightSample { + + /** + * <p>Executing {@link #printCurrentDay()} according to its documentation.</p> + * + * @param args Unused + */ + public static void main(String[] args) { + + System.out.println("Current date is:"); + + HighlightSample.printCurrentDay(); + } + + + /** + * <p>Printing current date and time.</p> + * + * <p>Usage sample:</p> + * + * <pre><code class="java"> final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + * LocalDateTime now = LocalDateTime.now(); + * System.out.println(dtf.format(now));</code></pre> + * + * <p>Illustrating syntax highlighting of different programming languages using a totally unrelated SQL example:</p> + * + * <pre><code class="sql"> CREATE TABLE CUSTOMERS( + * ID INT NOT NULL, + * NAME VARCHAR (20) NOT NULL, + * AGE INT NOT NULL, + * ADDRESS CHAR (25) , + * SALARY DECIMAL (18, 2), + * PRIMARY KEY (ID) + * )</code></pre> + * + */ + public static void printCurrentDay() { + final DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss"); + LocalDateTime now = LocalDateTime.now(); + System.out.println(dtf.format(now)); + } +} diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/Statistics.java b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/Statistics.java new file mode 100644 index 0000000000000000000000000000000000000000..201eb9fd1835a2d68a22201c9cefcc8befa96636 --- /dev/null +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/Statistics.java @@ -0,0 +1,35 @@ +package $package; + + +/** + * <p>The sole purpose of this class is about demonstrating + * <a target="_blank" href="https://www.latex-project.org">LaTeX</a> math formular support in Javadoc.</p> + * + */ +public class Statistics { + + /** + * <p>Computing the average of a given array's values</p> + * + * <p>Consider a series of values:</p> + * + * \[ \textbf{v} = \{v_1, v_2, \dots v_n\} \] + * + * <p>Its average is being defined as:</p> + * + * \[ \overline{\textbf{v}} = {1\over n}\sum_{i=1}^n {v_i} \] + * + * @param values A non-empty array of values. + * @return The average of all array values. + */ + public static double average(double[] values) { + + double result = 0; + for (final double v: values) { + result += v; + } + + return result / values.length; + + } +}