SoftwareEntwicklung Beratung Schulung

A coders, hackers heaven.....Hm...I do not think so...

Apache Maven Compiler Plugin Version 3.6.1 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven Compiler Plugin, version 3.6.1.

The Compiler Plugin is used to compile the sources of your project.

Attention: Starting with version 3.5, the maven-compiler-plugin requires Maven 3 and won’t work with Maven 2 anymore.

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.6.1</version>
</plugin>

Most important change is the support for test-compile when using JDK 9 build b148+

MojoHaus License Maven Plugin Version 1.12 Released

| Comments

The Mojo team is pleased to announce the release of the License Maven Plugin, version 1.12.

This plugin manages the license of a maven project and its dependencies (update file headers, download dependencies licenses, check thirdparty licenses, …).

To get this update, simply specify the version in your project`s plugin configuration:

1
2
3
4
5
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>license-maven-plugin</artifactId>
  <version>1.12</version>
</plugin>

Release Notes for License Maven Plugin Version 1.12

http://www.mojohaus.org/license-maven-plugin/github-report.html

Enjoy,

The Mojo team.

Tony

The Jenkins API Client for Java Version 0.3.7 Released

| Comments

We have released a new version of the The Jenkins API client for Java. The new released 0.3.7 contains several bugfixes and new features. Detailed information about the changes can be found in the release notes.

This is the second release under the Jenkins Github Organization umbrella.

  • Build class offers now two different methods to get the test informations. Using either getTestResult() for non maven type jobs or getTestReport() for maven type jobs.

  • New methods have been added to change the description of a job. The display name and/or the description of a build can be changed.

  • Added new helper class has been added to trigger a job wait until the job is finished.

  • All build methods of Job now consistently giving back a QueueReference.

  • Now you can request to get all builds back of a job which was not possible in previous releases.

The Jenkins API client for Java allows you to get informations about builds for example the duration of a build or test report informations.

Details API changes are documented in the release notes.

Apache Maven Dependency Plugin Version 3.0.0 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven Dependecy Plugin, version 3.0.0.

The dependency plugin provides the capability to manipulate artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified location.

https://maven.apache.org/plugins/maven-dependency-plugin/

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>3.0.0</version>
</plugin>

You can download the appropriate sources etc. from the download page:

https://maven.apache.org/plugins/maven-dependency-plugin/download.cgi

Apache Maven PMD Plugin Version 3.7 Released

| Comments

The Maven team is pleased to announce the release of the Apache Maven PMD Plugin, version 3.7

A Maven plugin for the PMD toolkit, that produces a report on both code rule violations and detected copy and paste fragments, as well as being able to fail the build based on these metrics.

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-pmd-plugin</artifactId>
  <version>3.7</version>
</plugin>

The Jenkins API Client for Java Version 0.3.6 Released

| Comments

We have released a new version of the The Jenkins API client for Java. The new released 0.3.6 contains several bugfixes and new features. Detailed information about the changes can be found in the release notes.

This is the first release under the Jenkins Github Organization umbrella.

  • The TestReport can now be used from the general Build as well as from MavenBuild
  • Changed getComputerSet().getComputer() into getComputerSet().getComputers() cause it returned a list and more than one element.
  • Added several renameJob() methods with support for the crumbFlag.
  • A job can now being deleted from within a folder.

The Jenkins API client for Java allows you to get informations about builds for example the duration of a build or test report informations.

Details API changes are documented in the release notes.

Apache Maven Plugin Tools Version 3.5 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven Plugin Tools, version 3.5.

The Maven Plugin Tools contains the necessary tools to generate rebarbative content like descriptor, help and documentation. In addition, it provides tools to write Maven Plugins in scripting languages like Ant or Beanshell.

The Maven Plugin Plugin is used to create a Maven plugin descriptor for any Mojo’s found in the source tree, to include in the JAR. It is also used to generate report files for the Mojos as well as for updating the plugin registry, the artifact metadata and generating a generic help goal.

http://maven.apache.org/plugin-tools/maven-plugin-plugin/

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-plugin-plugin</artifactId>
  <version>3.5</version>
</plugin>

You can download the appropriate sources etc. from the download page.

Apache Maven WAR Plugin Version 3.0.0 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven WAR Plugin, version 3.0.0.

The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive.

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>3.0.0</version>
</plugin>

You can download the appropriate sources etc. from the download page.

Important Note:

  • Maven 3.X only
  • JDK 6 minimum requirement

Maven Incremental Module Build

| Comments

If you are working with a Maven Multi Module Build on command line it could happen that you might think: Wouldn’t it be nice to build only the modules which you have changed and not all modules in the reactor.

You can of course control what you build by using the --projects command line option and add the appropriate modules you would like to build. For example like this:

1
mvn --projects module1,module2 clean package

But you need to think everytime you run the build about which modules have been changed and you need to adapt the list of changed modules manually.

Apart from that you need to think about the case if your modules are used by other modules in your build. This means module1 is a module dependency of another module. This can simply handled by Maven automatically by using the command line option --also-make-dependents which will build the modules which are dependencies of the modules given in the projects list.

1
mvn --projects module1,module2 --also-make-dependents clean package

There are often suggestions to change into the directory of the module you would like to build but this is simply wrong. If you start the build there Maven will read only the pom file of that single module and you have no chance of letting Maven anlyze the modules and their needed order etc. So always keep in the root directory of your multi module build and select the appropriate modules via --projects option.

The above will of course fine but this is cumbersome.

All this steps I have described can be handled in an automatic way by using the The Incremental Module Builder extensions.

To use the Incremental Module Build you need to run at best Maven 3.3.1+ and Java 7 as Maven 3.3.1+ itself. Furthermore you should configure it via the extensions.xml file in the .mvn/ folder of your project which should look like this:

1
2
3
4
5
6
7
8
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
  <extension>
    <groupId>com.soebes.maven.extensions</groupId>
    <artifactId>incremental-module-builder</artifactId>
    <version>0.1.0</version>
  </extension>
</extensions>

Another prerequisite is having configured correctly the scm area in your root pom of the project cause those information are used to analyze for changed files. You can run the incremental module builder via:

1
mvn -b incremental package

which will printout something similar like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
~/ws-git/supose (master *)$ mvn -b incremental package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Subversion Repository Search Engine
[INFO] SupoSE :: Test
[INFO] SupoSE :: Filter
[INFO] SupoSE :: Filter : Filter Model
[INFO] SupoSE :: Filter : Filter
[INFO] SupoSE :: Core
[INFO] SupoSE :: CLI
[INFO] SupoSE :: WAR
[INFO] SupoSE :: Integration Test
[INFO] SupoSE :: Users Guide
[INFO] SupoSE :: Assembly
[INFO]  ------------------------------------
[INFO]  Maven Incremental Module Builder
[INFO]  Version: 0.1.0
[INFO]  ------------------------------------
[INFO]
[INFO] Using the IncrementalModuleBuilder implementation with a thread count of 3
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose' && 'git' 'rev-parse' '--show-toplevel'
[INFO] Working directory: /Users/kama/ws-git/supose
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose' && 'git' 'status' '--porcelain' '.'
[INFO] Working directory: /Users/kama/ws-git/supose
[INFO]  Changed file: supose-cli/pom.xml modified
[INFO] Changed Project: com.soebes.supose:supose-cli:jar:0.7.1-SNAPSHOT
[INFO] New Calculated Reactor:
[INFO]  SupoSE :: CLI
[INFO]  SupoSE :: Assembly
[INFO] Building project: com.soebes.supose:supose-cli:jar:0.7.1-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SupoSE :: CLI 0.7.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ supose-cli ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ supose-cli ---
[INFO] Executing: /bin/sh -c cd '/Users/kama/ws-git/supose/supose-cli' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /Users/kama/ws-git/supose/supose-cli
[INFO] Storing buildNumber: 2cf6fbf37dbd3a0922ebd607a5b0504e76a0fd76 at timestamp: 1470779925110
[INFO] Storing buildScmBranch: master
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ supose-cli ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ supose-cli ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ supose-cli ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ supose-cli ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ supose-cli ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.soebes.supose.cli.SuposeCLITest
Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.527 sec - in com.soebes.supose.cli.SuposeCLITest

Results :

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

[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ supose-cli ---
[INFO]
[INFO] --- maven-site-plugin:3.5.1:attach-descriptor (attach-descriptor) @ supose-cli ---
[INFO] Building project: com.soebes.supose:supose-assembly:pom:0.7.1-SNAPSHOT
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SupoSE :: Assembly 0.7.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-maven) @ supose-assembly ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ supose-assembly ---
[INFO]
[INFO] --- maven-site-plugin:3.5.1:attach-descriptor (attach-descriptor) @ supose-assembly ---
[INFO]
[INFO] --- appassembler-maven-plugin:1.10:assemble (default) @ supose-assembly ---
[INFO]
[INFO] --- maven-assembly-plugin:2.6:single (default) @ supose-assembly ---
[INFO] Reading assembly descriptor: src/main/assembly/bin.xml
[INFO] Reading assembly descriptor: src/main/assembly/bin-unix.xml
[INFO] Reading assembly descriptor: src/main/assembly/src.xml
[INFO] Building zip: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-bin.zip
[INFO] Building tar: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-bin-unix.tar.gz
[INFO] Building tar: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-src.tar.gz
[INFO] Building zip: /Users/kama/ws-git/supose/supose-assembly/target/supose-assembly-0.7.1-SNAPSHOT-src.zip
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] SupoSE :: CLI ...................................... SUCCESS [ 16.145 s]
[INFO] SupoSE :: Assembly ................................. SUCCESS [  2.425 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.853 s (Wall Clock)
[INFO] Finished at: 2016-08-09T23:59:02+02:00
[INFO] Final Memory: 27M/437M
[INFO] ------------------------------------------------------------------------

As you can see the Incremental Module Builder will analyze automatically which modules have been changed and will also build the dependent modules. There is one point which is not very convinient. You always need to give on command line the -b incrmental part. But this can be handled by using the .mvn/maven.config file with the following content:

1
-b incremental

form this point on you can do it simply via:

1
mvn package

If you like to prevent usage of the incremental module build you can simply force this by using this:

1
mvn -b multithreaded package

which is the default which is used by Maven.

Currently the Incremental Module Builder is in a proof of concept state but it works for me and helped me a lot. If you find issues please don’t hesitate to file in an issue report. Apart from that any feedback is welcome.