Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom builds of Gradle cause NumberFormatException #96

Open
quidryan opened this issue Oct 9, 2014 · 5 comments
Open

Custom builds of Gradle cause NumberFormatException #96

quidryan opened this issue Oct 9, 2014 · 5 comments
Assignees
Milestone

Comments

@quidryan
Copy link

@quidryan quidryan commented Oct 9, 2014

On https://github.com/akhikhl/gretty/blob/master/libs/gretty/src/main/groovy/org/akhikhl/gretty/GrettyPlugin.groovy#L583:

int releaseNumber = project.gradle.gradleVersion.split('\\.')[1] as int

This assumes that the second part of the split is a simple number. In my case, I have a custom build (or a snapshot build of Gradle) which looks like this: 1.12-20140612154955+0000. That causes this exception:

Caused by: java.lang.NumberFormatException: For input string: "12-20140612154955+0000"
  at org.akhikhl.gretty.GrettyPlugin.apply(GrettyPlugin.groovy:580)
  at org.akhikhl.gretty.GrettyPlugin.apply(GrettyPlugin.groovy)
  at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104)
  at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
  at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
@akhikhl
Copy link
Owner

@akhikhl akhikhl commented Oct 9, 2014

Hi Justin,
This is clearly a bug. I'll try to fix it ASAP. Would you be ready to test the fix on snapshot version?

@akhikhl akhikhl added the bug label Oct 9, 2014
@akhikhl akhikhl self-assigned this Oct 9, 2014
@akhikhl
Copy link
Owner

@akhikhl akhikhl commented Oct 9, 2014

I managed to reproduce and fix this bug.
The fix is available in Gretty 1.1.5-SNAPSHOT.
If you want to use snapshot versions, you'll need to add http://oss.jfrog.org/artifactory/oss-snapshot-local to buildscript and project repositories.

@akhikhl akhikhl added this to the 1.1.5 milestone Oct 10, 2014
@akhikhl
Copy link
Owner

@akhikhl akhikhl commented Oct 15, 2014

Could you, please, test whether snapshot version fixes the problem?
Using snapshot version is easy:

buildscript {
  repositories {
    jcenter()
    maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
  }

  dependencies {
    classpath 'org.akhikhl.gretty:gretty:1.1.5-SNAPSHOT'
  }
}

repositories {
  jcenter()
  maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}

apply plugin: 'org.akhikhl.gretty'
@akhikhl
Copy link
Owner

@akhikhl akhikhl commented Oct 28, 2014

Gretty version 1.1.5 is out, with the abovementioned fix. Could you, please, try it?

@akhikhl
Copy link
Owner

@akhikhl akhikhl commented Jan 25, 2015

Hi Justin,
Does Gretty 1.1.8 fix this bug for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.