Getting a NoClassDefFoundError when using functions of libraries with maven

Discussion in 'Plugin Development' started by marcelo.mb, Dec 21, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    marcelo.mb

    Hey Guys, I am developing a plugin. I want to connect the plugin with firebase and use maven for this. As I heard I must use the maven-shade-plugin that the maven libraries are going to import into the .jar files. So my pom.xml looks like this:

    Code:
    <?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>
    
        <groupId>test.test_server_manager</groupId>
        <artifactId>server_manager</artifactId>
        <version>1.0</version>
    
        <dependencies>
            <dependency>
                <groupId>com.google.firebase</groupId>
                <artifactId>firebase-admin</artifactId>
                <version>6.6.0</version>
            </dependency>
        </dependencies>
    
        <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <minimizeJar>true</minimizeJar>
                            <artifactSet>
                                <includes>
                                    <include>mkremins:fanciful</include>
                                    <include>org.json:json</include>
                                </includes>
                            </artifactSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        </build>
    
    </project>
    After adding that I already had the same error: NoClassDefFoundError. So how to fix this at all.
    Thanks in advance.

    Still looking for an answer...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 22, 2018
Thread Status:
Not open for further replies.

Share This Page