Teaser
Für die Entwicklung mit maven gibt es viele Plugins hier stelle ich die Plugins vor mit ihren Konfigurationen vor, die ich generell für sinnvoll erachte. Zu jedem Plugin werde ich auch einen Link zu offiziellen Dokumentation anhängen, um die vorgeschlagenen Konfiguration anzupassen.
Compiler-Plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
Resources-Plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Source-Plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
Javadoc-Plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<show>protected</show>
<nohelp>true</nohelp>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
Site-Plugin
Swagger-Plugin
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/yaml/swagger.yaml</inputSpec>
<language>java</language>
<addCompileSourceRoot>false</addCompileSourceRoot>
<configOptions>
<dateLibrary>java8</dateLibrary>
<sourceFolder>src/java/generated</sourceFolder>
</configOptions>
<modelPackage>net.sudau.sample.rest.generated.model</modelPackage>
<apiPackage>net.sudau.sample.rest.generated</apiPackage>
<invokerPackage>net.sudau.sample.rest.generated</invokerPackage>
</configuration>
</execution>
</executions>
</plugin>