sbt / sbt-pom-reader

Translates xml -> awesome. Maven-ish support for sbt.
Other
76 stars 27 forks source link

compile fails with no settings.xml #15

Closed crispywalrus closed 10 years ago

crispywalrus commented 10 years ago

Sine ~/.m2/settings.xml is not a required file if no such file exits defaults should be set. Currently no settings.xml file cause a file not found exception. Adding this:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                                     http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>
  <servers/>
  <mirrors/>
  <proxies/>
  <profiles/>
  <activeProfiles/>
</settings>

fixes the issue, so no settings data is actually required.

compile [trace] Stack trace suppressed: run last :credentials for the full output. [error](:credentials) java.io.FileNotFoundException: /Users/cvale/.m2/settings.xml (No such file or directory) [error] Total time: 0 s, completed Jun 17, 2014 11:43:21 AM last :credentials java.io.FileNotFoundException: /Users/cvale/.m2/settings.xml (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:131) at sbt.Using$$anonfun$fileInputStream$1.apply(Using.scala:80) at sbt.Using$$anonfun$fileInputStream$1.apply(Using.scala:80) at sbt.Using$$anon$2.openImpl(Using.scala:72) at sbt.OpenFile$class.open(Using.scala:46) at sbt.Using$$anon$2.open(Using.scala:70) at sbt.Using$$anon$2.open(Using.scala:70) at sbt.Using.apply(Using.scala:24) at com.typesafe.sbt.pom.MavenHelper$.settingsXml(MavenHelper.scala:179) at com.typesafe.sbt.pom.MavenHelper$.settingsXmlServers(MavenHelper.scala:198) at com.typesafe.sbt.pom.MavenHelper$.createSbtCredentialsFromSettingsXml(MavenHelper.scala:244) at com.typesafe.sbt.pom.MavenHelper$$anonfun$pullSettingsFromPom$8.apply(MavenHelper.scala:68) at com.typesafe.sbt.pom.MavenHelper$$anonfun$pullSettingsFromPom$8.apply(MavenHelper.scala:68) at sbt.Scoped$RichInitialize$$anonfun$map$1$$anonfun$apply$3.apply(Structure.scala:177) at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45) at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:45) at sbt.std.Transform$$anon$4.work(System.scala:64) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) at sbt.Execute.work(Execute.scala:244) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160) at sbt.CompletionService$$anon$2.call(CompletionService.scala:30) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) [error](:credentials) java.io.FileNotFoundException: /Users/cvale/.m2/settings.xml (No such file or directory)

ScrapCodes commented 10 years ago

This is fixed in current version. See https://github.com/sbt/sbt-pom-reader/commit/22174a89421c08ee4cfa65b69876e6f9891f5682

jsuereth commented 10 years ago

Thanks!