DropWizard archetype version 2.0.0 vs 4.0.0 vs 4.0.8
[1] What is archetype version?
In the context of Dropwizard, an archetype version refers to a specific version of a project template that you can use to bootstrap a new Dropwizard application. Dropwizard is a Java framework for developing RESTful web services, and it provides a set of tools and libraries for building production-ready applications.
When you create a new Dropwizard project using Maven, you can specify an archetype version to ensure that your project is set up with the appropriate dependencies and structure for that version of Dropwizard. The archetype contains predefined files, configurations, and code samples that help you get started quickly.
To find the available archetype versions, you can check the official Dropwizard documentation or the Maven Central Repository for the specific versions of the Dropwizard archetype you're interested in.
Example Maven Command
Here's an example command to create a new Dropwizard project using a specific archetype version:
mvn archetype:generate -DgroupId=com.example -DartifactId=myapp -DarchetypeArtifactId=dropwizard-archetype -DarchetypeVersion=2.0.0
In this command, replace 2.0.0
with the desired archetype version you want to use.
When discussing Dropwizard archetype versions, particularly 2.0.0, 4.0.0, and 4.0.8, it’s important to consider the changes, improvements, and potential breaking changes introduced in each version. Here’s a brief overview of each:
1. Dropwizard 2.0.0
Release Date: Early 2020
Key Features:
Introduced support for Java 11.
Improved metrics and health checks.
Enhanced configuration management.
Updated dependencies to newer versions, particularly in the Jersey and Hibernate ecosystem.
Breaking Changes: Some deprecated methods and classes from earlier versions may have been removed or changed, requiring code updates.
2. Dropwizard 4.0.0
Release Date: Late 2021
Key Features:
Significant enhancements in performance and scalability.
Added support for Java 17.
Introduced new metrics and improved reporting capabilities.
Enhanced security features and updated dependencies to support newer libraries.
Breaking Changes: More substantial API changes compared to 2.x, which may affect compatibility with applications built on previous versions.
3. Dropwizard 4.0.8
Release Date: Following the 4.0.0 release (specific date may vary).
Key Features:
This version typically includes bug fixes and minor improvements over 4.0.0.
It often addresses security vulnerabilities discovered after the 4.0.0 release.
Continued enhancements to performance and stability.
Breaking Changes: Generally, fewer breaking changes compared to 4.0.0, focusing more on maintenance and stability.
Comparison Summary
Java Support: 2.0.0 supports Java 11, while 4.0.0 and 4.0.8 support Java 17.
Performance Improvements: 4.x versions provide better performance and scalability features.
Security and Dependencies: 4.x versions have updated dependencies, which are crucial for security and compatibility with newer libraries.
API Changes: Transitioning from 2.0.0 to 4.0.0 may require more significant code changes due to breaking changes in the API.
Considerations for Migration
Compatibility: If you have an existing application on 2.x, migrating to 4.x may require a thorough review of your codebase to address breaking changes.
New Features: Evaluate if the new features in 4.x versions provide significant benefits for your application.
Long-term Support: Using the latest version (4.0.8) is generally recommended for better support and security patches.
[2] The folder and file structure for Dropwizard projects
The folder and file structure for Dropwizard projects is generally consistent across versions, but there are some differences in configuration and dependencies due to changes in the framework.
Typical Folder/File Structure
Common Structure for Both Versions
myapp/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── example/
│ │ │ ├── MyApplication.java
│ │ │ ├── MyConfiguration.java
│ │ │ └── resources/
│ │ │ └── MyResource.java
│ │ ├── resources/
│ │ │ └── config.yml
│ └── test/
│ └── java/
│ └── com/
│ └── example/
│ └── MyApplicationTest.java
├── pom.xml
└── README.md
Key Differences
1. Dependencies in pom.xml
Dropwizard 2.0.0: Uses dependencies compatible with Java 11 and earlier libraries.
Dropwizard 4.0.0: Upgrades dependencies to support Java 17 and includes newer versions of libraries like Jersey, Hibernate, and metrics libraries.
2. Configuration Changes
- In
MyConfiguration.java
, there may be new configuration options or changed defaults in 4.0.0. For instance, security features may have been enhanced.
3. Resource Classes
- The way resources are registered in
MyApplication.java
may differ slightly, especially if new annotations or features have been introduced in 4.0.0.
4. New Features and Best Practices
- 4.0.0 may introduce new best practices or recommended patterns that might not be present in 2.0.0. For example, new metrics or health check mechanisms might be more streamlined.
5. Testing Frameworks
- The testing dependencies may also differ, with 4.0.0 potentially including updated versions of testing libraries.
[3] Version 2.0.0
PS C:\Users\User\DropWizardProductRestApi\drop200> mvn archetype:generate -DarchetypeGroupId='io.dropwizard.archetypes' -DarchetypeArtifactId='java-simple' -DarchetypeVersion='2.0.0'
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> archetype:3.2.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< archetype:3.2.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- archetype:3.2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [io.dropwizard.archetypes:java-simple:4.0.8] found in catalog remote
Define value for property 'name': demo
[INFO] Using property: description = null
[INFO] Using property: shaded = true
Define value for property 'groupId': com.example
Define value for property 'artifactId': demo
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' com.example: :
Confirm properties configuration:
name: demo
description: null
shaded: true
groupId: com.example
artifactId: demo
version: 1.0-SNAPSHOT
package: com.example
Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: java-simple:2.0.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example
[INFO] Parameter: packageInPathFormat, Value: com/example
[INFO] Parameter: shaded, Value: true
[INFO] Parameter: package, Value: com.example
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: name, Value: demo
[INFO] Parameter: description, Value: null
[INFO] Parameter: artifactId, Value: demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Project created from Archetype in dir: C:\Users\User\DropWizardProductRestApi\drop200\demo
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.024 s
[INFO] Finished at: 2024-09-12T08:02:44+08:00
[INFO] ------------------------------------------------------------------------
PS C:\Users\User\DropWizardProductRestApi\drop200>
2.0.0 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<dropwizard.version>2.0.0</dropwizard.version>
<mainClass>com.example.demoApplication</mainClass>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-dependencies</artifactId>
<version>${dropwizard.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
<!-- exclude signed Manifests -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>java11+</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<!--
Workaround for "javadoc: error - The code being documented uses modules but the packages
defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module."
-->
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
</profile>
</profiles>
</project>
[4] Version 4.0.0
PS C:\Users\User\DropWizardProductRestApi\drop400> mvn archetype:generate -DarchetypeGroupId='io.dropwizard.archetypes' -DarchetypeArtifactId='java-simple' -DarchetypeVersion='4.0.0'
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> archetype:3.2.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< archetype:3.2.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- archetype:3.2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [io.dropwizard.archetypes:java-simple:4.0.8] found in catalog remote
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.0/java-simple-4.0.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.0/java-simple-4.0.0.pom (1.5 kB at 4.5 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/dropwizard-archetypes/4.0.0/dropwizard-archetypes-4.0.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/dropwizard-archetypes/4.0.0/dropwizard-archetypes-4.0.0.pom (8.1 kB at 27 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.0/java-simple-4.0.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.0/java-simple-4.0.0.jar (6.3 kB at 22 kB/s)
Define value for property 'name': demo
[INFO] Using property: description = null
[INFO] Using property: shaded = true
Define value for property 'groupId': com.example
Define value for property 'artifactId': demo
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' com.example: :
Confirm properties configuration:
name: demo
description: null
shaded: true
groupId: com.example
artifactId: demo
version: 1.0-SNAPSHOT
package: com.example
Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: java-simple:4.0.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example
[INFO] Parameter: packageInPathFormat, Value: com/example
[INFO] Parameter: shaded, Value: true
[INFO] Parameter: package, Value: com.example
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: name, Value: demo
[INFO] Parameter: description, Value: null
[INFO] Parameter: artifactId, Value: demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Project created from Archetype in dir: C:\Users\User\DropWizardProductRestApi\drop400\demo
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35.339 s
[INFO] Finished at: 2024-09-12T08:00:34+08:00
[INFO] ------------------------------------------------------------------------
PS C:\Users\User\DropWizardProductRestApi\drop400>
4.0.0 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<dropwizard.version>4.0.0</dropwizard.version>
<mainClass>com.example.demoApplication</mainClass>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-dependencies</artifactId>
<version>${dropwizard.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.4.2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
<!-- exclude signed Manifests -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>java11+</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<!--
Workaround for "javadoc: error - The code being documented uses modules but the packages
defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module."
-->
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
</profile>
</profiles>
</project>
[5] 2.0.0 vs 4.0.0?
https://www.diffchecker.com/SegLC0oe/
[6] 4.0.8
PS C:\Users\User\DropWizardProductRestApi\drop408> mvn archetype:generate -DarchetypeGroupId='io.dropwizard.archetypes' -DarchetypeArtifactId='java-simple' -DarchetypeVersion='4.0.8'
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> archetype:3.2.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< archetype:3.2.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- archetype:3.2.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [io.dropwizard.archetypes:java-simple:4.0.8] found in catalog remote
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.8/java-simple-4.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.8/java-simple-4.0.8.pom (1.5 kB at 4.1 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/dropwizard-archetypes/4.0.8/dropwizard-archetypes-4.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/dropwizard-archetypes/4.0.8/dropwizard-archetypes-4.0.8.pom (9.0 kB at 33 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/dropwizard-project/4.0.8/dropwizard-project-4.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/dropwizard-project/4.0.8/dropwizard-project-4.0.8.pom (23 kB at 505 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.8/java-simple-4.0.8.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/dropwizard/archetypes/java-simple/4.0.8/java-simple-4.0.8.jar (6.3 kB at 21 kB/s)
Define value for property 'name': demo
[INFO] Using property: description = null
[INFO] Using property: shaded = true
Define value for property 'groupId': com.example
Define value for property 'artifactId': demo
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' com.example: :
Confirm properties configuration:
name: demo
description: null
shaded: true
groupId: com.example
artifactId: demo
version: 1.0-SNAPSHOT
package: com.example
Y: : y
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: java-simple:4.0.8
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: artifactId, Value: demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: com.example
[INFO] Parameter: packageInPathFormat, Value: com/example
[INFO] Parameter: shaded, Value: true
[INFO] Parameter: package, Value: com.example
[INFO] Parameter: groupId, Value: com.example
[INFO] Parameter: name, Value: demo
[INFO] Parameter: description, Value: null
[INFO] Parameter: artifactId, Value: demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Project created from Archetype in dir: C:\Users\User\DropWizardProductRestApi\drop408\demo
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.815 s
[INFO] Finished at: 2024-09-12T08:09:36+08:00
[INFO] ------------------------------------------------------------------------
PS C:\Users\User\DropWizardProductRestApi\drop408>
4.0.8 pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<dropwizard.version>4.0.8</dropwizard.version>
<mainClass>com.example.demoApplication</mainClass>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-dependencies</artifactId>
<version>${dropwizard.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.20.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.7.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
<!-- exclude signed Manifests -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>java11+</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<!--
Workaround for "javadoc: error - The code being documented uses modules but the packages
defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module."
-->
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
</profile>
</profiles>
</project>
4.0.0 vs 4.0.8?
Subscribe to my newsletter
Read articles from Mohamad Mahmood directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Mohamad Mahmood
Mohamad Mahmood
Mohamad's interest is in Programming (Mobile, Web, Database and Machine Learning). He studies at the Center For Artificial Intelligence Technology (CAIT), Universiti Kebangsaan Malaysia (UKM).