Comments (28)
These are the offending lines:
val fileParams = Map(parameters.toSeq map {
case (k, v) if k == "package" => (k, v.replaceAll("""\.""", System.getProperty("file.separator")))
case x => x
}: _*)
I wonder if relying on file.separator
doesn't work for Cygwin.
from giter8.
scala> "foo.bar".replaceAll("""\.""", """\""")
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
So I guess the second parameter is expecting a regex here. It's my bug.
from giter8.
Cool, thanks! Any idea how I can revert to a functional g8? I'm not familiar with conscript other than the instructions I was given about how to get g8.
Thanks!
Jeff
from giter8.
I think the best way is to not use package
property for now.
It's hard to prevent your users from using the latest g8, and package
feature was added in the latest anyway.
from giter8.
You can edit the launchconfig by hand, make it look like this: https://github.com/n8han/giter8/blob/952140a93cf224cd0684c1bc9b843d2307d61a9f/src/main/conscript/g8/launchconfig
The effective launchconfig should be here:
~/.conscript/n8han/giter8/g8/launchconfig
We can also make a "windows" branch that points to the old version, until this is fixed. Or if it's an easy fix I can release a new giter8 quickly. What do you think @eed3si9n ?
from giter8.
I just fixed it, but I have not tested it on Windows. After testing it maybe we can make another release.
from giter8.
Thanks very much for all the help guys. FYI, I'm an android-app template user, not the developer. I assume Jan wrote it?
Either way, I'm happy to test out the fix if you tell me where to point the launch config.
Thanks!
Jeff
from giter8.
There's a few steps:
$ git clone git://github.com/n8han/giter8.git
$ cd giter8
$ sbt publish-local
If that works, you can then hand-edit this
~/.conscript/n8han/giter8/g8/launchconfig
to change the version to 0.3.1-SNAPSHOT
(edited!)
Then just run g8 jberkel/android-app
and it should work.
from giter8.
I confirmed the fix for jberkel/android-app
and another template that uses package dir feature on Windows.
from giter8.
I guess that settles it! I'll release the new version tonight.
from giter8.
Thanks very much Eugine and Nathan! I know you don't need me to test it now, but I think I need the latest version of g8 anyhow to use the (presumably new template) in order new release of the android-plugin, yada yada.
Anyhow, I was able to check out the new version with git and ran sbt publish-local successfully:
git clone git://github.com/n8han/giter8.git
Cloning into giter8...
remote: Counting objects: 739,
...
[info] Done packaging.
[info] published giter8_2.9.1 to C:\Users\Jeff\.ivy2/local/net.databinder/giter8_2.9.1/0.3.1-SNAPSHOT/poms/giter8_2.9.1.pom
[info] published giter8_2.9.1 to C:\Users\Jeff\.ivy2/local/net.databinder/giter8_2.9.1/0.3.1-SNAPSHOT/jars/giter8_2.9.1.jar
[info] published ivy to C:\Users\Jeff\.ivy2/local/net.databinder/giter8_2.9.1/0.3.1-SNAPSHOT/ivys/ivy.xml
[success] Total time: 15 s, completed Nov 16, 2011 1:27:29 PM
I edited the launchconfig to read:
[app]
version: 4.1-SNAPSHOT
org: net.databinder
name: giter8
class: giter8.Giter8
[scala]
version: 2.9.1
[repositories]
local
scala-tools-releases
maven-central
[boot]
directory: /C:/Users/Jeff/.conscript/boot
But I get the following error. I think I ran into something like this before, but can't recall what the issue was. Any ideas? Thanks!
c:/Users/Jeff/bin/g8.bat jberkel/android-app
Getting net.databinder giter8_2.9.1 3.1-SNAPSHOT ...
:: problems summary ::
:::: WARNINGS
module not found: net.databinder#giter8_2.9.1;3.1-SNAPSHOT
==== local: tried
C:\Users\Jeff\.ivy2/local/net.databinder/giter8_2.9.1/3.1-SNAPSHOT/ivys/ivy.xml
-- artifact net.databinder#giter8_2.9.1;3.1-SNAPSHOT!giter8_2.9.1.jar:
C:\Users\Jeff\.ivy2/local/net.databinder/giter8_2.9.1/3.1-SNAPSHOT/jars/giter8_2.9.1.jar
==== Scala-Tools Maven2 Repository: tried
http://scala-tools.org/repo-releases/net/databinder/giter8_2.9.1/3.1-SNAPSHOT/giter8_2.9.1-3.1-SNAPSHOT.pom
-- artifact net.databinder#giter8_2.9.1;3.1-SNAPSHOT!giter8_2.9.1.jar:
http://scala-tools.org/repo-releases/net/databinder/giter8_2.9.1/3.1-SNAPSHOT/giter8_2.9.1-3.1-SNAPSHOT.jar
==== Maven Central: tried
http://repo1.maven.org/maven2/net/databinder/giter8_2.9.1/3.1-SNAPSHOT/giter8_2.9.1-3.1-SNAPSHOT.pom
-- artifact net.databinder#giter8_2.9.1;3.1-SNAPSHOT!giter8_2.9.1.jar:
http://repo1.maven.org/maven2/net/databinder/giter8_2.9.1/3.1-SNAPSHOT/giter8_2.9.1-3.1-SNAPSHOT.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: net.databinder#giter8_2.9.1;3.1-SNAPSHOT: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: net.databinder#giter8_2.9.1;3.1-SNAPSHOT: not found
Error during sbt execution: Error retrieving required libraries
(see C:\Users\Jeff\.conscript\boot\update.log for complete log)
Error: Could not retrieve giter8 3.1-SNAPSHOT
from giter8.
launchconfig's version should be 0.3.1-SNAPSHOT
.
from giter8.
Oops.. I had set it to 4.1-SNAPSHOT. Regardless, after repeating the steps and fixing it to 3.1, I get the same error. I'm using sbt 0.11.1 if it matters.
from giter8.
@n8han's original instruction said 3.1-SNAPSHOT
, but it should be 0.3.1-SNAPSHOT
.
from giter8.
Thanks Eugine, now I get a new error:
c:/Users/Jeff/bin/g8.bat jberkel/android-app
Getting net.databinder giter8_2.9.1 0.3.1-SNAPSHOT ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
14 artifacts copied, 0 already retrieved (1595kB/71ms)
java.lang.NoClassDefFoundError: dispatch/ImplicitRequestVerbs
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at xsbt.boot.Launch$ScalaProvider$AppProvider.mainClass(Launch.scala:143)
at xsbt.boot.Launch$ScalaProvider$AppProvider.newMain(Launch.scala:146)
at xsbt.boot.Launch$.run(Launch.scala:53)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: dispatch.ImplicitRequestVerbs
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 11 more
Error during sbt execution: java.lang.NoClassDefFoundError: dispatch/ImplicitRequestVerbs
from giter8.
I used the .exe version of 0.11.0. I wonder if this is sbt's #257.
from giter8.
My pom.xml looks ok, even when I published using 0.11.1.
from giter8.
I'm not familiar with the .exe version. I also can't find any easy way to access sbt's archived release jars and unfortunately didn't save my prior verison sbt jar. Can you try the .jar version? Out of curiosity, where did you find a windows executable version?
from giter8.
If it helps you get the jar version quicker, I'm using Cygwin, and here's my jar launch script. If you're not using the mintty terminal, remove -Djline.terminal=jline.UnixTerminal
java -Djline.terminal=jline.UnixTerminal -XX:MaxPermSize=256m -Xmx512M -XX:+CMSClassUnloadingEnabled -jar c:/...your-path-here.../bin/sbt-launch.jar "$@"
from giter8.
I got my .exe from the author's dropbox account, but it's also linked from http://xsbt.org/.
from giter8.
Odd, I downloaded the 0.1.0 exe distribution and replaced my script with the executable and I get a NoClassDefFoundError (albeit a new class):
c:/Users/Jeff/bin/g8.bat jberkel/android-app
java.lang.NoClassDefFoundError: dispatch/Http
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at xsbt.boot.Launch$ScalaProvider$AppProvider.mainClass(Launch.scala:143)
at xsbt.boot.Launch$ScalaProvider$AppProvider.newMain(Launch.scala:146)
at xsbt.boot.Launch$.run(Launch.scala:53)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: dispatch.Http
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 11 more
Error during sbt execution: java.lang.NoClassDefFoundError: dispatch/Http
from giter8.
FYI, when I reverted back to the 0.11.1 sbt jar version, the NoClassDefFoundError: dispatch/Http
error persisted (not the former NoClassDefFoundError: dispatch/ImplicitRequestVerbs
)
from giter8.
When I confirmed 0.11.1, that was jar version on Mac.
Could you try the following?
$ sbt "project app" publish-local
$ cs --clean-boot
$ g8
from giter8.
I assume you meant to run sbt "project app" publish-local
from within the giter8 directory? When I try to run cs --clean-boot
, I get Unable to delete C:\Users\Jeff\.conscript\boot\other\net.java.dev.jna\jna\3.2.3\jna-3.2.3.jar
So I manually deleted the file and then got the following output:
cs.bat --clean-boot
\Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
1 artifacts copied, 0 already retrieved (838kB/507ms)
Unable to delete C:\Users\Jeff\.conscript\boot\other\net.java.dev.jna\jna\3.2.3\jna-3.2.3.jar
And then after running g8, I'm still getting:
c:/Users/Jeff/bin/g8.bat
java.lang.NoClassDefFoundError: dispatch/Http
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at xsbt.boot.Launch$ScalaProvider$AppProvider.mainClass(Launch.scala:143)
at xsbt.boot.Launch$ScalaProvider$AppProvider.newMain(Launch.scala:146)
at xsbt.boot.Launch$.run(Launch.scala:53)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: dispatch.Http
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 11 more
Error during sbt execution: java.lang.NoClassDefFoundError: dispatch/Http
from giter8.
You have to delete the whole C:\Users\Jeff\.conscript\boot
directory, not just jna-3.2.3.jar
.
Just to make sure, I've wiped out my Ivy local and Ivy cache:
$ rm -rf /cygdrive/C/Users/foo/.ivy2/cache
$ rm -rf /cygdrive/C/Users/foo/.ivy2/local
and used jar version of sbt 0.11.1 on Cygwin.
What was interesting was that launcher-interface_2.9.1;0.11.0
stopped resolving. I guess because I didn't put the resolver for it. Running sbt 0.11.0 caches it locally, so did that. Published giter8 locally, deleted boot
dir manually, and ran g8
. It ran fine (after it downloading some jars).
from giter8.
Manually removing the boot directory did the trick--thanks much!
from giter8.
Released: http://implicit.ly/giter8-031
cs n8han/giter8
to upgrade.
from giter8.
Thanks very much again to both of you for all of the help and for the great tools.
from giter8.
Related Issues (20)
- Issue maintenance HOT 4
- Incorrect line-breaks in description property with manual line-breaks HOT 1
- Folder Template does not work properly on Windows HOT 4
- log4j errors when installed as bootstrap's sh HOT 1
- g8Test does not respect custom resolvers HOT 1
- Backstage + giter8 HOT 2
- Auth fail on sbt new HOT 2
- Support for Dynamic inputs from user
- Error with literals in json and sbt file
- Would it be possible to get a new release cut? HOT 2
- Template Not Found Error With Custom Template in a Multi Module Project
- Running scaffolds using the g8 command line tool
- A new release HOT 3
- Post Creation Hook
- Maven property resolves to a stale version HOT 3
- g8 template cant generate template on powershell
- Images are corrupted during local testing
- Template project code is not compiled during `test` HOT 4
- Allow specifying properties with arguments even if default resolution fails
- Can't pull a private repository HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from giter8.