Repository: incubator-s2graph Updated Branches: refs/heads/master d37888ff2 -> 6610285ad
[S2GRAPH-126] does not produce error even if ~/.m2/settings.xml does not exist Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/f4374095 Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/f4374095 Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/f4374095 Branch: refs/heads/master Commit: f4374095f5f33c84202d19fefb95d2d02b242966 Parents: 1c2bd04 Author: Jong Wook Kim <[email protected]> Authored: Wed Nov 9 16:22:40 2016 -0500 Committer: Jong Wook Kim <[email protected]> Committed: Wed Nov 9 16:27:37 2016 -0500 ---------------------------------------------------------------------- CHANGES | 3 +++ project/Publisher.scala | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/f4374095/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 8731236..cfeac6a 100644 --- a/CHANGES +++ b/CHANGES @@ -117,6 +117,9 @@ Release 0.1.0 - unreleased S2GRAPH-120: Netty version is conflict with play 2.5.9 (Committed by DOYUNG YOON). + S2GRAPH-126: SBT error when there is no ~/.m2/settings.xml + (Contributed by Jong Wook Kim<[email protected]>, committed by DOYUNG YOON) + TASKS S2GRAPH-2: Update document and quick start environment to have recent set-up command changes. http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/f4374095/project/Publisher.scala ---------------------------------------------------------------------- diff --git a/project/Publisher.scala b/project/Publisher.scala index 49364e4..7fb8d2b 100644 --- a/project/Publisher.scala +++ b/project/Publisher.scala @@ -1,5 +1,6 @@ import sbt.Keys._ import sbt._ +import scala.util.Try import scala.xml.XML object Publisher { @@ -17,9 +18,10 @@ object Publisher { } }, credentials ++= { - val xml = XML.loadFile(new File(System.getProperty("user.home")) / ".m2" / "settings.xml") - for (server <- xml \\ "server" if (server \ "id").text == "apache") yield { - Credentials("Sonatype Nexus Repository Manager", "repository.apache.org", (server \ "username").text, (server \ "password").text) + Try(XML.loadFile(new File(System.getProperty("user.home")) / ".m2" / "settings.xml")).toOption.toSeq.flatMap { xml => + for (server <- xml \\ "server" if (server \ "id").text == "apache") yield { + Credentials("Sonatype Nexus Repository Manager", "repository.apache.org", (server \ "username").text, (server \ "password").text) + } } }, pomIncludeRepository := { _ => false },
