SoftwareEntwicklung Beratung Schulung

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

Apache Maven Source Plugin Version 3.0.1 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven Source Plugin, Version 3.0.1.

The Source Plugin creates a jar archive of the source files of the current project. The jar file is, by default, created in the project’s target directory.

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

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

Apache Maven Shared Component - Maven Archiver Version 3.1.1 Released

| Comments

The Apache Maven team is pleased to announce the release of the Maven Archiver, version 3.1.1.

The Maven Archiver is mainly used by plugins to handle packaging. The version numbers referenced in the Since column on this page are the version of the Maven Archiver component – not for any specific plugin. To see which version of Maven Archiver a plugin uses, go to the site for that plugin.

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

1
2
3
4
5
<dependency>
  <groupId>org.apache.maven.shared</groupId>
  <artifactId>maven-archiver</artifactId>
  <version>3.1.1</version>
</plugin>

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

Important Notes since Version 3.0.0:

  • Maven 3.X only
  • JDK 6 minimum requirement

Maven Anti Patterns: Build Helper Maven Plugin

| Comments

In Maven builds I often see a pattern like the following:

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
<plugins>
  <plugin>
    <groupId>group</groupId>
    <artifactId>generatorPlugin</artifactId>
    <version>..</version>
    <configuration>
     ...
    </configuration>
  </plugin>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>...</version>
    <executions>
      <execution>
        <phase>generate-sources</phase>
        <goals>
          <goal>add-source</goal>
        </goals>
        <configuration>
          <sources>
            <source>target/generated-sources/WHATEVER</source>
          </sources>
        </configuration>
      </execution>
    </executions>
  </plugin>
</plugins>

The generatorPlugin is just a placeholder for different kinds of maven plugins which generate code for example ANTLR4 Maven Plugin, Templating Maven Plugin, JAXB2 Maven Plugin just to mention a few examples here.

Usually this can be reduced to the following:

1
2
3
4
5
6
7
8
9
10
<plugins>
  <plugin>
    <groupId>group</groupId>
    <artifactId>generatorPlugin</artifactId>
    <version>..</version>
    <configuration>
     ...
    </configuration>
  </plugin>
</plugins>

The reason is simple, cause those plugins already handle the task to add the generated source code to the correct parts in Maven to give for example the Maven Compiler Plugin a hint to compile also those generated java code.

Yes I know there are some of such plugins out there which do not do it in the correct way which means you need to add the Build Helper Maven Plugin snippet, but this means those plugins need some improvements. Those plugins violate the Convention over Configuration paradigm. Why? Simply cause you as user need to think about an internal detail of those plugins which is simply wrong. They have to handle that on their own.

A further note here. I do not say Build Helper Maven Plugin is wrong. It is the usage of the Build Helper Maven Plugin in the described relationship.

Apache Maven JavaDoc Plugin Version 2.10.4 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven JavaDoc Plugin, version 2.10.4.

The Javadoc Plugin uses the Javadoc tool to generate javadocs for the specified project.

Please be aware of the new location of our issue tracker which has been moved from Codehaus to Apache Software Foundation.

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

Apache Maven Shared Component - Maven Archiver Version 3.1.0 Released

| Comments

The Apache Maven team is pleased to announce the release of the Maven Archiver, version 3.1.0.

The Maven Archiver is mainly used by plugins to handle packaging. The version numbers referenced in the Since column on this page are the version of the Maven Archiver component – not for any specific plugin. To see which version of Maven Archiver a plugin uses, go to the site for that plugin.

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

1
2
3
4
5
<dependency>
  <groupId>org.apache.maven.shared</groupId>
  <artifactId>maven-archiver</artifactId>
  <version>3.1.0</version>
</plugin>

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

Important Notes since Version 3.1.0:

  • Maven 3.X only
  • JDK 6 minimum requirement

Apache Maven Shared Component - Maven Filtering Version 3.1.1 Released

| Comments

The Apache Maven team is pleased to announce the release of the Apache Maven Shared Component: Maven Filtering Version 3.1.1.

The goal is to provide a shared component for all plugins that needs to filter resources.

Important Note since Version 3.0.0:

  • Maven 3.X only
  • JDK 6 minimum requirement

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

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.shared</groupId>
  <artifactId>maven-filtering</artifactId>
  <version>3.1.1</version>
</plugin>

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