Skip to content

Commit

Permalink
Upgrade to Maven 3.5.0. Remove webdav support for now
Browse files Browse the repository at this point in the history
  • Loading branch information
hamnis committed Sep 5, 2017
1 parent 82fc225 commit f9191b0
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 146 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -99,7 +99,7 @@ To deploy to local maven repository.

Documentation for proxies can be found [here](http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html)

# Using the plugin with sbt-pgp-plugin 1.1.0-M1 or higher
# Using the plugin with sbt-pgp-plugin 1.1.0 or higher

You will need to add the sbt-pgp-plugin as described [here](https://github.com/sbt/sbt-pgp).

Expand Down
24 changes: 10 additions & 14 deletions build.sbt
Expand Up @@ -5,27 +5,27 @@ description := "Deploy in SBT using Sonatype Aether"
name := "aether-deploy"

libraryDependencies ++= {
val mavenVersion = "3.3.9"
val mavenVersion = "3.5.0"
val aetherVersion = "1.1.0"
Seq(
aetherExclude("org.apache.maven" % "maven-aether-provider" % mavenVersion),
"org.codehaus.plexus" % "plexus-interpolation" % "1.22",
"javax.inject" % "javax.inject" % "1" % "provided",
"org.codehaus.plexus" % "plexus-component-annotations" % "1.7.1" % "provided",
"org.sonatype.plexus" % "plexus-sec-dispatcher" % "1.4" exclude("org.codehaus.plexus", "plexus-utils"),
"com.google.inject" % "guice" % "4.0" exclude("com.google.guava", "guava"),
"org.apache.maven" % "maven-resolver-provider" % mavenVersion,
"org.codehaus.plexus" % "plexus-interpolation" % "1.24",
"org.apache.maven" % "maven-model" % mavenVersion,
"org.apache.maven" % "maven-core" % mavenVersion,
"org.eclipse.aether" % "aether-impl" % aetherVersion,
"org.eclipse.aether" % "aether-connector-basic" % aetherVersion,
"org.eclipse.aether" % "aether-transport-http" % aetherVersion exclude("org.apache.httpcomponents", "httpclient"),
"org.eclipse.aether" % "aether-transport-file" % aetherVersion,
"org.eclipse.aether" % "aether-transport-wagon" % aetherVersion exclude("org.apache.maven.wagon", "wagon-provider-api"),
"org.apache.maven.wagon" % "wagon-provider-api" % "2.12",
"ch.qos.logback" % "logback-classic" % "1.2.2",
"org.apache.httpcomponents" % "httpclient" % "4.5.3" exclude("commons-logging", "commons-logging"),
"javax.inject" % "javax.inject" % "1" % "provided",
"org.codehaus.plexus" % "plexus-component-annotations" % "1.7.1" % "provided"
"org.apache.httpcomponents" % "httpclient" % "4.5.3" exclude("commons-logging", "commons-logging")
)
}

dependencyOverrides += "org.slf4j" % "jcl-over-slf4j" % "1.7.25"

scalacOptions := Seq("-deprecation", "-unchecked")

sbtPlugin := true
Expand All @@ -42,9 +42,5 @@ scriptedBufferLog := false
libraryDependencies += {
val sbtV = (sbtBinaryVersion in pluginCrossBuild).value
val scalaV = (scalaBinaryVersion in pluginCrossBuild).value
sbt.Defaults.sbtPluginExtra("com.jsuereth" % "sbt-pgp" % "1.1.0-M1" % "provided", sbtV, scalaV)
}

def aetherExclude(moduleId: ModuleID): ModuleID = {
List("aether-api", "aether-spi", "aether-util", "aether-impl").foldLeft(moduleId)((m, s) => m.exclude("org.eclipse.aether", s))
sbt.Defaults.sbtPluginExtra("com.jsuereth" % "sbt-pgp" % "1.1.0" % "provided", sbtV, scalaV)
}
3 changes: 2 additions & 1 deletion project/plugins.sbt
@@ -1,5 +1,6 @@

libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
13 changes: 6 additions & 7 deletions src/main/scala/aether/Plugin.scala
Expand Up @@ -17,7 +17,6 @@ object AetherKeys {
val aetherDeploy = TaskKey[Unit]("aether-deploy", "Deploys to a maven repository.")
val aetherInstall = TaskKey[Unit]("aether-install", "Installs to a local maven repository.")
val aetherPackageMain = taskKey[File]("package main Artifact")
val aetherWagons = settingKey[Seq[WagonWrapper]]("The configured extra maven wagon wrappers.")
val aetherLocalRepo = settingKey[File]("Local maven repository.")
val aetherOldVersionMethod = settingKey[Boolean]("Flag for using the old method of getting the version")
}
Expand Down Expand Up @@ -47,7 +46,7 @@ object AetherPlugin extends AetherPlugin {
trait AetherPlugin extends AutoPlugin {

lazy val aetherBaseSettings: Seq[Setting[_]] = Seq(
aetherWagons := Seq.empty,
//aetherWagons := Seq.empty,
aetherLocalRepo := Path.userHome / ".m2" / "repository",
defaultCoordinates,
deployTask,
Expand All @@ -72,7 +71,7 @@ trait AetherPlugin extends AutoPlugin {
lazy val deployTask = aetherDeploy := (Def.taskDyn{
if ((publishArtifact in Compile).value) {
Def.task {
deployIt(publishTo.value, aetherLocalRepo.value, aetherArtifact.value, sbtPlugin.value, aetherWagons.value, credentials.value)(streams.value)
deployIt(publishTo.value, aetherLocalRepo.value, aetherArtifact.value, sbtPlugin.value, credentials.value)(streams.value)
}
} else {
Def.task(())
Expand Down Expand Up @@ -102,7 +101,7 @@ trait AetherPlugin extends AutoPlugin {
builder.build()
}

def deployIt(repo: Option[Resolver], localRepo: File, artifact: AetherArtifact, plugin: Boolean, wagons: Seq[WagonWrapper], cred: Seq[Credentials])(implicit s: TaskStreams) {
def deployIt(repo: Option[Resolver], localRepo: File, artifact: AetherArtifact, plugin: Boolean, cred: Seq[Credentials])(implicit strem: TaskStreams) {
val repository = repo.collect{
case x: MavenRepository => x
case x => sys.error("The configured repo MUST be a maven repo, but was: " + x)
Expand All @@ -112,7 +111,7 @@ trait AetherPlugin extends AutoPlugin {
val href = URI.create(repository.root)
val c = Credentials.forHost(cred, href.getHost)
if (c.isEmpty && href.getHost != null) {
s.log.warn("No credentials supplied for %s".format(href.getHost))
strem.log.warn("No credentials supplied for %s".format(href.getHost))
}
c
}
Expand All @@ -124,7 +123,7 @@ trait AetherPlugin extends AutoPlugin {
artifact.subartifacts.foreach(s => request.addArtifact(s.toArtifact(parent)))

try {
val (system, session) = Booter(localRepo, s, wagons, plugin)
val (system, session) = Booter(localRepo, strem, plugin)
system.deploy(session, request)
}
catch {
Expand All @@ -140,7 +139,7 @@ trait AetherPlugin extends AutoPlugin {
artifact.subartifacts.foreach(s => request.addArtifact(s.toArtifact(parent)))

try {
val (system, session) = Booter(localRepo, streams, Nil, plugin)
val (system, session) = Booter(localRepo, streams, plugin)
system.install(session, request)
}
catch {
Expand Down
12 changes: 4 additions & 8 deletions src/main/scala/aether/internal/Booter.scala
Expand Up @@ -13,19 +13,16 @@ import org.eclipse.aether.spi.connector.transport.TransporterFactory
import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory
import org.eclipse.aether.spi.connector.RepositoryConnectorFactory
import org.eclipse.aether.spi.locator.Service
import org.eclipse.aether.transport.wagon.{WagonTransporterFactory, WagonConfigurator, WagonProvider}
import org.eclipse.aether.transport.file.FileTransporterFactory
import org.eclipse.aether.transport.http.HttpTransporterFactory


import sbt.std.TaskStreams

object Booter {
private def newRepositorySystem(wagons: Seq[WagonWrapper], plugin: Boolean): RepositorySystem = {
private def newRepositorySystem(plugin: Boolean): RepositorySystem = {
val locator = new DefaultServiceLocator()
locator.addService(classOf[RepositoryLayoutFactory], classOf[SbtPluginLayoutFactory])
locator.setServices(classOf[WagonProvider], new ExtraWagonProvider(wagons))
locator.setServices(classOf[WagonConfigurator], NoOpWagonConfigurator)
locator.addService(classOf[VersionResolver], classOf[DefaultVersionResolver])
locator.addService(classOf[VersionRangeResolver], classOf[DefaultVersionRangeResolver])
locator.addService(classOf[ArtifactDescriptorReader], classOf[DefaultArtifactDescriptorReader])
Expand All @@ -50,8 +47,8 @@ object Booter {
system
}

def apply(localRepoDir: File, streams: TaskStreams[_], wagons: Seq[WagonWrapper] = Nil, plugin: Boolean = false): (RepositorySystem, RepositorySystemSession) = {
val system = newRepositorySystem(wagons, plugin)
def apply(localRepoDir: File, streams: TaskStreams[_], plugin: Boolean = false): (RepositorySystem, RepositorySystemSession) = {
val system = newRepositorySystem(plugin)
system -> newSession(system, localRepoDir, streams)
}

Expand All @@ -72,10 +69,9 @@ object Booter {

val services = Seq(
configure(new HttpTransporterFactory()),
configure(new WagonTransporterFactory()).setPriority(1000f),
configure(new FileTransporterFactory()).setPriority(10000f)
)

locator.setServices(classOf[TransporterFactory], services : _*)
}
}
39 changes: 0 additions & 39 deletions src/main/scala/aether/wagon.scala

This file was deleted.

Expand Up @@ -6,4 +6,4 @@ throw new RuntimeException("""

addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % pluginVersion)

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
2 changes: 1 addition & 1 deletion src/sbt-test/deploy/webapp/project/plugins.sbt
Expand Up @@ -4,6 +4,6 @@ throw new RuntimeException("""
|Specify this property using the scriptedLaunchOpts -D.
""".stripMargin))

addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "2.0.4")
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.0")

addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % pluginVersion)
8 changes: 0 additions & 8 deletions src/sbt-test/webdav/webdav-auth/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions src/sbt-test/webdav/webdav-auth/build.sbt

This file was deleted.

4 changes: 0 additions & 4 deletions src/sbt-test/webdav/webdav-auth/credentials

This file was deleted.

9 changes: 0 additions & 9 deletions src/sbt-test/webdav/webdav-auth/project/plugins.sbt

This file was deleted.

2 changes: 0 additions & 2 deletions src/sbt-test/webdav/webdav-auth/test

This file was deleted.

8 changes: 0 additions & 8 deletions src/sbt-test/webdav/webdav/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions src/sbt-test/webdav/webdav/build.sbt

This file was deleted.

9 changes: 0 additions & 9 deletions src/sbt-test/webdav/webdav/project/plugins.sbt

This file was deleted.

2 changes: 0 additions & 2 deletions src/sbt-test/webdav/webdav/test

This file was deleted.

0 comments on commit f9191b0

Please sign in to comment.