Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>All you need is to define a property file <strong><code>sbt.boot.properties</code></strong> which will allow you to:</p> <ul> <li>redefine the ivy cache location (I need that because it would be otherwise part of our <a href="http://en.wikipedia.org/wiki/Roaming_user_profile" rel="noreferrer">roaming Windows profile</a>, which is severely limited in disk space in our shop. See <a href="http://code.google.com/p/simple-build-tool/issues/detail?id=74&amp;can=1" rel="noreferrer">Issue 74</a>)</li> <li>define any other Maven repo you want</li> </ul> <pre> C:\HOMEWARE\apps\sbt-0.74\sbt.boot.properties [scala] version: 2.7.7 # classifiers: sources, javadoc [app] org: org.scala-tools.sbt name: sbt version: read(sbt.version) class: sbt.xMain components: xsbti cross-versioned: true classifiers: sources, javadoc [repositories] local my-nexus: http://my.nexus/nexus/content/repositories/scala-tools/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext] maven-local # sbt-db: http://databinder.net/repo/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext] # maven-central # scala-tools-releases # scala-tools-snapshots [boot] directory: project/boot properties: project/build.properties prompt-create: Project does not exist, create new project? prompt-fill: true quick-option: true [log] level: debug [app-properties] project.name: quick=set(test), new=prompt(Name)[p], fill=prompt(Name) project.organization: new=prompt(Organization)[org.vonc] project.version: quick=set(1.0), new=prompt(Version)[1.0], fill=prompt(Version)[1.0] build.scala.versions: quick=set(2.8.0.RC2), new=prompt(Scala version)[2.8.0.RC2], fill=prompt(Scala version)[2.8.0.RC2] sbt.version: quick=set(0.7.4), new=prompt(sbt version)[0.7.4], fill=prompt(sbt version)[0.7.4] project.scratch: quick=set(true) project.initialize: quick=set(true), new=set(true) [ivy] cache-directory: C:\HOMEWARE\projects\.ivy2\cache </pre> <p>Note: this <code>sbt.boot.properties</code> file is inspired from:</p> <ul> <li>the one mentioned in the <a href="http://code.google.com/p/simple-build-tool/wiki/GeneralizedLauncher#Configuration" rel="noreferrer">"Generalized Launcher" page of the sbt project</a>.</li> <li>the one found within <code>sbt-0.74</code> itself!</li> </ul> <p>I have commented any <em>external</em> Maven repository definition, and added a reference to my own Nexus Maven repo.</p> <blockquote> <p>The launcher may be configured in one of the following ways in increasing order of precedence:</p> <ul> <li>Replace the <code>/sbt/sbt.boot.properties</code> file in the <code>jar</code>.</li> <li>Put a configuration file named <code>sbt.boot.properties</code> on the classpath. Put it in the classpath root without the <code>/sbt</code> prefix.</li> <li>Specify the location of an alternate configuration on the command line. This can be done by: <ul> <li>either specifying the location as the system property <code>sbt.boot.properties</code> </li> <li>or as the first argument to the launcher prefixed by '<code>@</code>'. </li> </ul></li> </ul> <p>The system property has lower precedence.<br> Resolution of a relative path is:</p> <ul> <li>first attempted against the current working directory, </li> <li>then against the user's home directory, </li> <li>and then against the directory containing the launcher jar. </li> </ul> <p>An error is generated if none of these attempts succeed.</p> </blockquote> <hr> <p>Define a sbt.bat wrapper (in order to be sure to specify <em>your</em> <code>sbt.boot.properties</code>) like:</p> <pre><code>C:\HOMEWARE&gt;more C:\HOMEWARE\bin\sbt.BAT @echo off set t=%~dp0 set adp0=%t:C:\="%" set SBT_DIR=%adp0%..\apps\sbt-0.74 dir C:\%SBT_DIR%\sbt-launch-0.7.4.jar # if needed, add your proxy settings set PROXY_OPTIONS=-Dhttp.proxyHost=my.proxy -Dhttp.proxyPort=80xx -Dhttp.proxyUser=auser -Dhttp.proxyPassword=yyyy set JAVA_OPTIONS=-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -cp C:\HOMEWARE\apps\sbt-0.74\sbt-launch-0.7.4 set SBT_BOOT_PROPERTIES=-Dsbt.boot.properties="sbt.boot.properties" cmd /C C:\HOMEWARE\apps\jdk4eclipse\bin\java.exe %PROXY_OPTIONS% %JAVA_OPTIONS% %SBT_BOOT_PROPERTIES% -jar C:\HOMEWARE\apps\sbt-0.74\sbt-launch-0.7.4.jar %* </code></pre> <p>And your sbt will download artifacts <strong><em>only</em></strong> from:</p> <ul> <li>your Nexus</li> <li>your local Maven repo.</li> </ul> <hr> <p>Just tested at home with an old Nexus opensource 1.6 I had running, java 1.6, sbt07.4</p> <pre><code>C:\Prog\Java\jdk1.6.0_18\jre\bin\java -Xmx512M -Dsbt.boot.properties=sbt.boot.properties - jar "c:\Prog\Scala\sbt\sbt-launch-0.7.4.jar" </code></pre> <p>That gives:</p> <pre><code>[success] Build completed successfully. C:\Prog\Scala\tests\pp&gt;sbt Getting Scala 2.8.0 ... downloading http://localhost:8081/nexus/content/repositories/scala/org/scala-lang/scala-compiler/2.8.0/scala-compiler-2. 8.0.jar ... [SUCCESSFUL ] org.scala-lang#scala-compiler;2.8.0!scala-compiler.jar (311ms) downloading http://localhost:8081/nexus/content/repositories/scala/org/scala-lang/scala-library/2.8.0/scala-library-2.8. 0.jar ... [SUCCESSFUL ] org.scala-lang#scala-library;2.8.0!scala-library.jar (185ms) :: retrieving :: org.scala-tools.sbt#boot-scala confs: [default] 2 artifacts copied, 0 already retrieved (14484kB/167ms) [info] Building project test 0.1 against Scala 2.8.0 [info] using sbt.DefaultProject with sbt 0.7.4 and Scala 2.7.7 </code></pre> <p>If I try a funny value in the sbt.boot.properties file:</p> <pre><code>C:\Prog\Scala\tests\pp&gt;sbt Getting Scala 2.9.7 ... :: problems summary :: :::: WARNINGS module not found: org.scala-lang#scala-compiler;2.9.7 ==== nexus: tried http://localhost:8081/nexus/content/repositories/scala/org/scala-lang/scala-compiler/2.9.7/scala-compiler-2.9.7.pom -- artifact org.scala-lang#scala-compiler;2.9.7!scala-compiler.jar: http://localhost:8081/nexus/content/repositories/scala/org/scala-lang/scala-compiler/2.9.7/scala-compiler-2.9.7.jar </code></pre> <p>So it does limit itself to the two repo I defined:</p> <pre><code>[repositories] nexus: http://localhost:8081/nexus/content/repositories/scala nexus2: http://localhost:8081/nexus/content/repositories/scala, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext] </code></pre> <p>(I commented everything else: <code>local</code>, <code>maven-local</code>, ...)</p> <p>If I comment <em>all</em> repositories and put a funny value (2.7.9) for the scala version in the <code>sbt.boot.properties</code>, I do get (like the OP did)</p> <pre><code>C:\Prog\Scala\tests\pp&gt;sbt Error during sbt execution: No repositories defined. </code></pre> <p>If I put 2.7.7 (while still having <em>all</em> repo commented), yes, it won't generate an error:</p> <pre><code>C:\Prog\Scala\tests\pp&gt;sbt [info] Building project test 0.1 against Scala 2.8.0 [info] using sbt.DefaultProject with sbt 0.7.4 and Scala 2.7.7 </code></pre> <p><strong>But that's only because it already had downloaded scala2.8.0 during my previous tries.</strong><br> If I remove that library from my <code>project/boot</code> directory, then it will throw an Exception:</p> <pre><code>[info] using sbt.DefaultProject with sbt 0.7.4 and Scala 2.7.7 &gt; C:\Prog\Scala\tests\pp&gt;sbt Error during sbt execution: No repositories defined. at xsbt.boot.Pre$.error(Pre.scala:18) at xsbt.boot.Update.addResolvers(Update.scala:197) ... at xsbt.boot.Boot$.main(Boot.scala:15) at xsbt.boot.Boot.main(Boot.scala) Error loading project: Error during sbt execution: No repositories defined. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload