arktekk / sbt-aether-deploy

Deploy SBT artifacts using Maven Artifact Resolver (formerly Eclipse Aether)
Other
84 stars 31 forks source link

aether-deploy ignores SBT artifact config #36

Closed F30 closed 8 years ago

F30 commented 8 years ago

For a project, we're trying to just publish the fat JAR from sbt-assembly instead of the a thin JAR. As described in the SBT docs, we use the following line to omit the thin JAR from publishing:

publishArtifact in (Compile, packageBin) := false

However, this does not park with aether-deploy and the thin JAR still gets published. Is this the intended behavior or a bug? If it's intended, is there a possible workaround?

hamnis commented 8 years ago

So you want to replace the main artifact with the assembly artifact?

The "thin" jar, is the main artifact of the deployment, and Maven requires a Main artifact. if you want to replace which artifact is used as the main artifact you can add this in your build file:

import aether.AetherKeys._

aetherPackageMain := assembly.value
F30 commented 8 years ago

Yes, exactly.

Thanks for your solution! It works great, but I had to slightly tweak it in order to make type and operator match:

aetherPackageMain <<= assembly

The publishArtifact in (Compile, packageBin) line from my original approach is still required additionally.

F30 commented 8 years ago

… or even nicer, using SBT 0.13 format:

aetherPackageMain := assembly.value
svsatheeshkumar commented 5 years ago

I tried this options and its not working. Anyting I am missing.

aetherPackageMain := assembly.value