Re: Publish to S3 maven repo

125 views
Skip to first unread message

Andres March

unread,
Mar 15, 2013, 3:17:01 PM3/15/13
to simple-b...@googlegroups.com
Thanks to jsuereth for helping me out.  I still wish I could figure out how to do this by extending a resolver and using publish.

import sbt._


import Keys._


import play.Project._




import com.typesafe.sbt.S3Plugin._


import S3._


import sbtassembly.Plugin.AssemblyKeys


import sbtassembly.Plugin.AssemblyKeys._


import sbtassembly.Plugin.assemblySettings


import sbtassembly.Plugin.MergeStrategy


import sbtbuildinfo.Plugin._




object ApplicationBuild extends Build {




  val appName = "og-ws"


  val appVersion = "1.0-SNAPSHOT"




  val appDependencies = Seq(


    // Add your project dependencies here,


    jdbc,


    anorm,


    "com.netflix.astyanax" % "astyanax-cassandra" % "1.56.28",


    "com.netflix.astyanax" % "astyanax-thrift" % "1.56.28",


    "com.netflix.astyanax" % "astyanax-entity-mapper" % "1.56.28")




  val main = (


    play.Project(appName, appVersion, appDependencies)


    settings (s3Settings: _*)


    settings (assemblySettings: _*)


    settings (


      // call its setters to configure it, see api docs above etc.


      publish := (),


      publishLocal := (),


      mappings in upload <<= dist map { distFile =>


        Seq(distFile -> "snapshot/%s/%s/%s-%s.zip".format(appName, appVersion, appName, appVersion))


      },


      host in upload := "plaor.maven.s3.amazonaws.com",


      credentials += Credentials(Path.userHome / ".s3credentials")))


}



Alexey Alekhin

unread,
Mar 15, 2014, 2:49:31 PM3/15/14
to simple-b...@googlegroups.com
Don't know, if it's still actual, but just in case somebody will find this question later, here is a plugin that we use for publishing to S3: https://github.com/ohnosequences/sbt-s3-resolver

On Thursday, March 14, 2013 3:18:33 AM UTC+1, Andres March wrote:

I know this has already been asked but nothing came of it:



I need to publish to a maven repo in S3 from sbt.  I have been reading the docs and am still not sure how I'm supposed to extend sbt to do this.  The one page on custom resolvers is for a build resolver which seems like a different thing.  There doesn't seem to be much info on extending the publishing mechanism to other repository schemes.  This is simply a maven repository in terms of layout but I will need to use the s3 api to publish.

Could someone give me a hint as to how to extend the Repository and/or Resolver to publish to S3?  I thought I might be able to just create a Resolver and a factory for a MavenRepo but it appears there is a case pattern match on MavenRepo somewhere that overrides the resolver.

Even the typesafe guys didn't seem to use sbt traits and just went with some custom file upload using sbt-s3 plugin jboner created.  I couldn't get that to work and I would prefer to use sbt API if possible.

But at this point I will take any advice at all.

thanks.
Reply all
Reply to author
Forward
0 new messages