TrigonicSolutions / gradle-rpm-plugin

Gradle plugin for constructing RPM packages.
Apache License 2.0
38 stars 19 forks source link

InetAddress.localHost can throw an exception #21

Closed seanjreilly closed 11 years ago

seanjreilly commented 11 years ago

We've just started using this gradle plugin, and it's working great, but we've discovered one issue.

In some cases, the call to InetAddress.localHost (on line 41 of Rpm.gradle) can throw an UnknownHostException. When this happens the plugin crashes.

This pull request is a potential fix that catches the exception and uses a sensible default (the string 'unknown'). A unit test is also included.

(The pull request also includes the work I needed to do to get the gradle script to work with IntelliJ, and some very minor code cleanup. Neither of those commits is relevant to the bug per se.)

AlanKrueger commented 11 years ago

Thanks for the submission, and thanks in particular for including a test. =)

seanjreilly commented 11 years ago

You're welcome. Any idea when this might be released in a new official version?

AlanKrueger commented 11 years ago

Just deployed a snapshot build of 1.2 to Sonatype. Are you in a position to test out the snapshot? https://oss.sonatype.org/content/repositories/snapshots/com/trigonic/gradle-rpm-plugin/1.2-SNAPSHOT/

seanjreilly commented 11 years ago

We should be. It's the end of the workday, but we'll move to the snapshot version tomorrow and give it a try.

seanjreilly commented 11 years ago

We're using the 1.2 snapshot build, and it's working fine for us.

AlanKrueger commented 11 years ago

Version 1.2 has been pushed to Sonatype staging and released. It should appear on Maven Central shortly.

seanjreilly commented 11 years ago

It's there now, and we're already using it. Thanks so much for the quick attention!