reines / dropwizard-debpkg-maven-plugin

A maven plugin for packing Dropwizard applications as Debian packages.
Apache License 2.0
52 stars 12 forks source link

Error: Failed to execute goal com.jamierf.dropwizard:dropwizard-debpkg-maven-plugin:0.9:dwpackage (default) #23

Open peavers opened 8 years ago

peavers commented 8 years ago

I think this is more user error than issue, but struggling to get this to work. I've simply added the plugin with the default configuration from the readme and I'm attempting to package my app but receive the following error: [ERROR] Failed to execute goal com.jamierf.dropwizard:dropwizard-debpkg-maven-plugin:0.9:dwpackage (default) on project org.squandered.weather: Execution default of goal com.jamierf.dropwizard:dropwizard-debpkg-maven-plugin:0.9:dwpackage failed: Failed to find main class in artifact jar -> [Help 1]

I'm very new to maven so I think I've just not set something correctly here... Should the goal be my package?

Do you have a "in the wild" working example I can poke at?

grommitz commented 8 years ago

The jar you are packaging probably needs to be an executable jar with a main class in the manifest. You can use the shade plugin to build your executable jar. HTH

ezweave commented 8 years ago

I'm seeing the same thing, but I am building an executable jar. What is bizarre is that this was working up until a few days ago.

ezweave commented 8 years ago

This is my shade config... again, this was just working. I might have to start a bisect.

`

org.apache.maven.plugins
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.3</version>
    <configuration>
      <createDependencyReducedPom>true</createDependencyReducedPom>
      <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>
        <configuration>
          <transformers>
            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
              <mainClass>com.fake.Main</mainClass>
            </transformer>
          </transformers>
        </configuration>
      </execution>
    </executions>
  </plugin>`

I changed the name of the mainClass, but that is academic (just for the sake of posting).