Maven Demo with fancy POM

This page shows a Maven demo using a fancy POM to work under Java 11, to build a runnable Jar, to generate extensive documentation (site), and other fancy stuff.

C:\Temp>mvn --version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T14:41:47-04:00)
Maven home: C:\Java\maven
Java version: 11.0.2, vendor: Oracle Corporation, runtime: C:\Java
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

C:\Temp>mvn archetype:generate -DgroupId=com.wpollock.hello -DartifactId=hello -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: C:\Users\wpollock\Temp\maven sandbox
[INFO] Parameter: package, Value: com.wpollock.hello
[INFO] Parameter: groupId, Value: com.wpollock.hello
[INFO] Parameter: artifactId, Value: hello
[INFO] Parameter: packageName, Value: com.wpollock.hello
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: C:\Temp\hello
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.496 s
[INFO] Finished at: 2018-01-24T00:48:04-05:00
[INFO] Final Memory: 16M/53M
[INFO] ------------------------------------------------------------------------

C:\Temp>cd hello
C:\Temp\hello>tree/f
Folder PATH listing for volume OSDisk
Volume serial number is 6891-6A55
C:.
│   pom.xml
│
└───src
    ├───main
    │   └───java
    │       └───com
    │           └───wpollock
    │               └───hello
    │                       App.java
    │
    └───test
        └───java
            └───com
                └───wpollock
                    └───hello
                            AppTest.java


C:\Temp\hello>mkdir src\main\resources
C:\Temp\hello>mkdir src\test\resources
C:\Temp\hello>notepad pom.xml
C:\Temp\hello>notepad src\test\java\com\wpollock\hello\AppTest.java
C:\Temp\hello>mvn clean install exec:java site
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.wpollock.hello:hello >----------------------
[INFO] Building hello 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hello ---
[INFO] Deleting C:\Users\wpollock\Temp\maven sandbox\fancy\hello\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\wpollock\Temp\maven sandbox\fancy\hello\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hello ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\wpollock\Temp\maven sandbox\fancy\hello\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hello ---
[INFO] Surefire report directory: C:\Users\wpollock\Temp\maven sandbox\fancy\hello\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.wpollock.hello.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:3.1.1:jar (default-jar) @ hello ---
[INFO] Building jar: C:\Users\wpollock\Temp\maven sandbox\fancy\hello\target\hello-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ hello ---
[INFO] Installing C:\Users\wpollock\Temp\maven sandbox\fancy\hello\target\hello-1.0-SNAPSHOT.jar to C:\Users\wpollock\.m2\repository\com\wpollock\hello\hello\1.0-SNAPSHOT\hello-1.0-SNAPSHOT.jar
[INFO] Installing C:\Users\wpollock\Temp\maven sandbox\fancy\hello\pom.xml to C:\Users\wpollock\.m2\repository\com\wpollock\hello\hello\1.0-SNAPSHOT\hello-1.0-SNAPSHOT.pom
[INFO] 
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ hello ---
Hello World!
[INFO] 
[INFO] --- maven-site-plugin:3.7.1:site (default-site) @ hello ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-surefire-report-plugin:2.22.1
[INFO] preparing maven-surefire-report-plugin:report report requires '[surefire]test' forked phase execution
[INFO] 
[INFO] >>> maven-surefire-report-plugin:2.22.1:report > [surefire]test @ hello >>>
...
[INFO] Generating "Dependency Information" report --- maven-project-info-reports-plugin:3.0.0:dependency-info
[INFO] Generating "About" report                --- maven-project-info-reports-plugin:3.0.0:index
[INFO] Generating "Licenses" report             --- maven-project-info-reports-plugin:3.0.0:licenses
[INFO] Generating "Plugin Management" report    --- maven-project-info-reports-plugin:3.0.0:plugin-management
[INFO] Generating "Plugins" report              --- maven-project-info-reports-plugin:3.0.0:plugins
[INFO] Generating "Summary" report              --- maven-project-info-reports-plugin:3.0.0:summary
[INFO] Generating "Team" report                 --- maven-project-info-reports-plugin:3.0.0:team
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.429 s
[INFO] Finished at: 2019-04-09T02:46:12-04:00
[INFO] ------------------------------------------------------------------------

C:\Temp\hello>tree
Folder PATH listing for volume OSDisk
Volume serial number is 6891-6A55
C:.
├───src
│   ├───main
│   │   ├───java
│   │   │   └───com
│   │   │       └───wpollock
│   │   │           └───hello
│   │   └───resources
│   └───test
│       ├───java
│       │   └───com
│       │       └───wpollock
│       │           └───hello
│       └───resources
└───target
    ├───classes
    │   └───...
    ├───site
    │   ├───apidocs
    │   │   ├───...
    │   ├───css
    │   ├───images
    │   │   └───logos
    │   ├───testapidocs
    │   │   ├───...
    │   ├───xref
    │   │   └───com
    │   │       └───wpollock
    │   │           └───hello
    │   └───xref-test
    │       └───com
    │           └───wpollock
    │               └───hello
    ├───surefire-reports
    └───test-classes
        └───com
            └───wpollock
                └───hello

C:\Temp\hello>mvn versions:display-dependency-updates
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.wpollock.hello:hello >----------------------
[INFO] Building hello 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.7:display-dependency-updates (default-cli) @ hello ---
[INFO] The following dependencies in Dependencies have newer versions:
[INFO]   junit:junit ...................................... 4.12 -> 4.13-beta-2
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.077 s
[INFO] Finished at: 2019-04-09T02:55:42-04:00
[INFO] ------------------------------------------------------------------------