Solved Maven Dependencies not being included in final jar file

Discussion in 'Plugin Development' started by Dragonphase, Feb 20, 2014.

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

    Dragonphase

    I am trying to include dependencies in my final build, but it won't work. The dependencies I am using are from this library, and I have made sure that my pom.xml contains the exact same as what the installation setup section on that page says.

    When the plugin reaches a point that requires the dependencies, I get the following:

    "Caused by: java.lang.NoClassDefFoundError: mkremins/fanciful/FancyMessage"

    I have no idea what to do to resolve this issue, as I am fairly new with using dependencies in maven. Some help would be greatly appreciated!
     
  2. Offline

    xTrollxDudex

    Dragonphase
    Add include dependencies to to maven compiler plugin
     
  3. Offline

    Dragonphase

    xTrollxDudex Nvm, I had to use maven shade plugin to do that, so it's all working now. what I had to include:

    Code:
        <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>
     
    Pando likes this.
Thread Status:
Not open for further replies.

Share This Page