I have a multi module maven project which I build with maven's shade plugin. I have a module called "distribution" which includes all the other modules and then builds. My problem is that I have a maven dependency which I have in another module and I cannot find a solution where the distribution module includes it in the shaded jar.
The core module which contains the dependency (group id dev.demeng):
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>InventoryArchiver-core</artifactId>
<version>${project.parent.version}</version>
<packaging>jar</packaging>
<parent>
<groupId>dev.nandi0813</groupId>
<artifactId>InventoryArchiver-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<!-- Vault -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>demeng-repo</id>
<name>Demeng's Repository</name>
<url>https://repo.demeng.dev/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.demeng</groupId>
<artifactId>sentinel-java-wrapper</artifactId>
<version>1.2.0</version>
<exclusions>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
Distribution pom:
<artifactId>InventoryArchiver-distribution</artifactId>
<version>${project.parent.version}</version>
<packaging>jar</packaging>
<parent>
<groupId>dev.nandi0813</groupId>
<artifactId>InventoryArchiver-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<defaultGoal>clean install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<artifactSet>
<includes>
<include>dev.nandi0813:InventoryArchiver-*</include>
<include>dev.demeng.sentinel.wrapper</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>dev.demeng.sentinel.wrapper</pattern>
<shadedPattern>dev.nandi0813.inventoryarchiver.sentinel</shadedPattern>
</relocation>
</relocations>
<createDependencyReducedPom>false</createDependencyReducedPom>
<finalName>inventoryArchiver-${project.version}</finalName>
<outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>dev.nandi0813</groupId>
<artifactId>InventoryArchiver-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>dev.nandi0813</groupId>
<artifactId>InventoryArchiver-spigot_1_8</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>dev.nandi0813</groupId>
<artifactId>InventoryArchiver-spigot_1_12_2</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>dev.nandi0813</groupId>
<artifactId>InventoryArchiver-spigot_1_13_2</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
I solved the problem.
It was a : symbol instead of . in the include section...
dev.demeng.sentinel.wrapper