Importing a project from Git directly

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Importing a project from Git directly

marcos rebelo
Hi all,

I have this project (it is my first open source, Alpha at this point):
https://github.com/oleber/aws-stepfunctions

I have a second project that should import the first one. On the second project I did something like:

lazy val awsStepFunctions = RootProject(uri("git://github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5"))

lazy val importerWithStepFunction = project.in(file("modules/importerWithStepFunction"))
  .settings(global: _*)
  .dependsOn(
    awsStepFunctions % allScopes,
    commonCommons % allScopes,
    home24AWS % allScopes,
    importerBing % allScopes
  )


and I get an error like:

[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: default#aws-stepfunctions_2.11;1.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]     Note: Unresolved dependencies path:
[warn]         default:aws-stepfunctions_2.11:1.0
[warn]           +- de.home24:importerwithstepfunction_2.11:0.1-SNAPSHOT


Clearly I'm missing something. Can you direct me to the solution or to documentation? I will work something.

Best Regards

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Importing a project from Git directly

Rafał Krzewski
I don't think you can depend on sources of another project located in a remote git repository.

SBT supports dependencies between submodules of a single (root) project and supports dependencies on binaries (jars) available in Maven and Ivy repositories.

You should set organization property in build.sbt of your aws-stepfunctions project, let's assume organization := "oleber.github.com"
Then build the binary artifact and deploy it to your local repository on your machine by running sbt publishLocal in the working copy directory of aws-stepfunction project  
And finally add the following dependency to your "second project":
libraryDependencies ++= Seq(
"oleber.github.com" % "aws-stepfunctions" %% "1.0"
)

please note that "oleber.github.com" % "aws-stepfunctions" %% "1.0" is equivalent to "oleber.github.com" % "aws-stepfunctions_2.12" % "1.0" provided that binary scala version in the importing project is 2.12.

If you would like to make aws-stepfunctions publicly available, you should take a look at https://github.com/sbt/sbt-bintray and https://github.com/xerial/sbt-sonatype plugins.

Hope that helps,
Rafał

W dniu wtorek, 17 stycznia 2017 10:09:29 UTC+1 użytkownik marcos rebelo napisał:
Hi all,

I have this project (it is my first open source, Alpha at this point):
<a href="https://github.com/oleber/aws-stepfunctions" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;">https://github.com/oleber/aws-stepfunctions

I have a second project that should import the first one. On the second project I did something like:

lazy val awsStepFunctions = RootProject(uri("git://<a href="http://github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;">github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5"))

lazy val importerWithStepFunction = <a href="http://project.in" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;">project.in(file("modules/importerWithStepFunction"))
  .settings(global: _*)
  .dependsOn(
    awsStepFunctions % allScopes,
    commonCommons % allScopes,
    home24AWS % allScopes,
    importerBing % allScopes
  )


and I get an error like:

[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: default#aws-stepfunctions_2.11;1.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]     Note: Unresolved dependencies path:
[warn]         default:aws-stepfunctions_2.11:1.0
[warn]           +- de.home24:importerwithstepfunction_2.11:0.1-SNAPSHOT


Clearly I'm missing something. Can you direct me to the solution or to documentation? I will work something.

Best Regards

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Importing a project from Git directly

Lutz Huehnken
In reply to this post by marcos rebelo

Not an expert on this, but could it be the different Scala versions? oleber/aws-stepfunctions is Scala 2.12, the project you try to include it in seems to be 2.11 (guessing, as it's looking for a 2.11 artifact. I don't think sbt automatically crosscompiles the project you depend on to 2.11. If I were you, my first attempt would be to try if it works if both projects have the same Scala version (from the snippet of your build.sbt, I think it should).


On Tuesday, 17 January 2017 10:09:29 UTC+1, marcos rebelo wrote:
Hi all,

I have this project (it is my first open source, Alpha at this point):
<a href="https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;">https://github.com/oleber/aws-stepfunctions

I have a second project that should import the first one. On the second project I did something like:

lazy val awsStepFunctions = RootProject(uri("git://<a href="http://github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;">github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5"))

lazy val importerWithStepFunction = <a href="http://project.in" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;">project.in(file("modules/importerWithStepFunction"))
  .settings(global: _*)
  .dependsOn(
    awsStepFunctions % allScopes,
    commonCommons % allScopes,
    home24AWS % allScopes,
    importerBing % allScopes
  )


and I get an error like:

[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: default#aws-stepfunctions_2.11;1.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]     Note: Unresolved dependencies path:
[warn]         default:aws-stepfunctions_2.11:1.0
[warn]           +- de.home24:importerwithstepfunction_2.11:0.1-SNAPSHOT


Clearly I'm missing something. Can you direct me to the solution or to documentation? I will work something.

Best Regards

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Importing a project from Git directly

Lutz Huehnken

Ok, just realized the commit you're referring to is actually Scala 2.11. I was looking at HEAD. So my theory is wrong. Then I don't know.


On Tuesday, 17 January 2017 17:36:56 UTC+1, Lutz Huehnken wrote:

Not an expert on this, but could it be the different Scala versions? oleber/aws-stepfunctions is Scala 2.12, the project you try to include it in seems to be 2.11 (guessing, as it's looking for a 2.11 artifact. I don't think sbt automatically crosscompiles the project you depend on to 2.11. If I were you, my first attempt would be to try if it works if both projects have the same Scala version (from the snippet of your build.sbt, I think it should).


On Tuesday, 17 January 2017 10:09:29 UTC+1, marcos rebelo wrote:
Hi all,

I have this project (it is my first open source, Alpha at this point):
<a href="https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;">https://github.com/oleber/aws-stepfunctions

I have a second project that should import the first one. On the second project I did something like:

lazy val awsStepFunctions = RootProject(uri("git://<a href="http://github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;">github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5"))

lazy val importerWithStepFunction = <a href="http://project.in" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;">project.in(file("modules/importerWithStepFunction"))
  .settings(global: _*)
  .dependsOn(
    awsStepFunctions % allScopes,
    commonCommons % allScopes,
    home24AWS % allScopes,
    importerBing % allScopes
  )


and I get an error like:

[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: default#aws-stepfunctions_2.11;1.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]     Note: Unresolved dependencies path:
[warn]         default:aws-stepfunctions_2.11:1.0
[warn]           +- de.home24:importerwithstepfunction_2.11:0.1-SNAPSHOT


Clearly I'm missing something. Can you direct me to the solution or to documentation? I will work something.

Best Regards

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Importing a project from Git directly

Lutz Huehnken
In reply to this post by Lutz Huehnken

And me again, really sorry for the noise, last e-mail for today I swear!

So I had another realization, I was actually _not_ looking at the wrong commit, but at something else entirely. So I'm back to my theory about the version mismatch. Try it with 

lazy val awsStepFunctions = ProjectRef(uri("git://github.com/lutzh/aws-stepfunctions.git#63f95882c096197e29edd4694147b55c9b3109be"), "aws-stepfunctions")

Works for me. Further evidence: Delete your .sbt/0.13/staging/ dir. Run your broken build. Check .sbt/0.13/staging/ again - you'll probably find aws-stepfunctions_2.12 artifacts somewhere in there.

Hope this helps, sorry again for the prematurely sent last message. If I have another realization in a few minutes that this is all utter nonsense, I won't write again - someone else will please have to point that out then.

Lutz



On Tuesday, 17 January 2017 17:36:56 UTC+1, Lutz Huehnken wrote:

Not an expert on this, but could it be the different Scala versions? oleber/aws-stepfunctions is Scala 2.12, the project you try to include it in seems to be 2.11 (guessing, as it's looking for a 2.11 artifact. I don't think sbt automatically crosscompiles the project you depend on to 2.11. If I were you, my first attempt would be to try if it works if both projects have the same Scala version (from the snippet of your build.sbt, I think it should).


On Tuesday, 17 January 2017 10:09:29 UTC+1, marcos rebelo wrote:
Hi all,

I have this project (it is my first open source, Alpha at this point):
<a href="https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions&amp;sa=D&amp;sntz=1&amp;usg=AFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNES954P4kWTGC7pjWDNSvw1YcsZvQ&#39;;return true;">https://github.com/oleber/aws-stepfunctions

I have a second project that should import the first one. On the second project I did something like:

lazy val awsStepFunctions = RootProject(uri("git://<a href="http://github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Foleber%2Faws-stepfunctions.git%2331990fce907cbda3814954c390dcbc1b7807b2d5\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF58wRTERj5QXrX_zLwbnZ17TtwaA&#39;;return true;">github.com/oleber/aws-stepfunctions.git#31990fce907cbda3814954c390dcbc1b7807b2d5"))

lazy val importerWithStepFunction = <a href="http://project.in" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fproject.in\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFgHKpoDUsZ13kEhD5C18nlzp2XsQ&#39;;return true;">project.in(file("modules/importerWithStepFunction"))
  .settings(global: _*)
  .dependsOn(
    awsStepFunctions % allScopes,
    commonCommons % allScopes,
    home24AWS % allScopes,
    importerBing % allScopes
  )


and I get an error like:

[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     ::          UNRESOLVED DEPENDENCIES         ::
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]     :: default#aws-stepfunctions_2.11;1.0: not found
[warn]     ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]     Note: Unresolved dependencies path:
[warn]         default:aws-stepfunctions_2.11:1.0
[warn]           +- de.home24:importerwithstepfunction_2.11:0.1-SNAPSHOT


Clearly I'm missing something. Can you direct me to the solution or to documentation? I will work something.

Best Regards

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.