java - Maven shade plugin isn't placing dependency class files into jar -
my maven project uses external library dependency, com.sk89q.intake:intake
, i'm trying package jar via maven-shade-plugin
. when building project, resulting jar not contain of class files of com.sk89q.intake:intake
. during build process, message, build continues on , succeeds:
[info] --- maven-shade-plugin:2.4.2:shade (default) @ eventmanagerplugin [info] no artifact matching filter com.sk89q.intake:intake
why happening? i'm able download, access, , use dependency in project, there shouldn't wrong naming of artifact.
pom.xml
<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> <groupid>deletethis.eventmanager</groupid> <artifactid>eventmanagerplugin</artifactid> <version>1.0.0-beta1</version> <repositories> <repository> <id>spigot-repo</id> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> </repository> <repository> <id>maven.sk89q.com</id> <url>http://maven.sk89q.com/repo/</url> </repository> </repositories> <dependencies> <dependency> <groupid>org.spigotmc</groupid> <artifactid>spigot-api</artifactid> <version>1.8.8-r0.1-snapshot</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.bukkit</groupid> <artifactid>bukkit</artifactid> <version>1.8.8-r0.1-snapshot</version> <scope>provided</scope> </dependency> <dependency> <groupid>com.sk89q.intake</groupid> <artifactid>intake</artifactid> <version>4.2-snapshot</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.5</version> <configuration> <archive> <manifestentries> <built-by>deletethis</built-by> </manifestentries> </archive> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <version>2.4.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>com.sk89q.intake:intake</artifact> <includes> <include>com/sk89q/intake/**</include> </includes> </filter> </filters> <relocations> <relocation> <pattern>com.sk89q.intake</pattern> <shadedpattern>deletethis.eventmanager.lib.com.sk89q.intake</shadedpattern> </relocation> </relocations> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
as can see, including com.sk89q.intake:intake
artifact. have looked through maven-shade-plugin
documentation , don't see i'm doing wrong. naming consistent have found online; is, groupid:artifactid
.
i have tried building without <relocation>
class relocation tags see if interfering.
it may useful know i'm using m2eclipse , building clean install
goals.
the problem declaring com.sk89q.intake:intake
dependency provided
scope.
provided dependency expected provided container @ runtime maven-shade-plugin
not add shaded jar. such, need remove provided
scope dependency declaration:
<dependency> <groupid>com.sk89q.intake</groupid> <artifactid>intake</artifactid> <version>4.2-snapshot</version> </dependency>
relevant build log after change:
[info] --- maven-shade-plugin:2.4.2:shade (default) @ test --- [info] including com.sk89q.intake:intake:jar:4.2-snapshot in shaded jar. [info] including com.google.guava:guava:jar:18.0 in shaded jar. [info] including com.google.code.findbugs:jsr305:jar:3.0.0 in shaded jar.
Comments
Post a Comment