Skip to content

Commit

Permalink
add classpath jar creation for windows os
Browse files Browse the repository at this point in the history
  • Loading branch information
atomfrede committed May 12, 2019
1 parent 2a5601d commit 407d00f
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion generators/server/templates/build.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-%>
buildscript {
import org.gradle.internal.os.OperatingSystem

buildscript {9713
repositories {
mavenLocal()
mavenCentral()
Expand Down Expand Up @@ -96,6 +98,26 @@ eclipse {
}
}

// See https://virgo47.wordpress.com/2018/09/14/classpath-too-long-with-spring-boot-and-gradle/ for details
// https://github.com/jhipster/generator-jhipster/issues/9713
if (OperatingSystem.current().isWindows()) {
task classpathJar(type: Jar) {
inputs.files sourceSets.main.runtimeClasspath

archiveName = "runboot-classpath.jar"
doFirst {
manifest {
def classpath = sourceSets.test.runtimeClasspath.files
attributes "Class-Path": classpath.collect {f -> f.toURI().toString()}.join(" ")
}
}
}

bootRun {
classpath = classpathJar.outputs.files
}
}

defaultTasks "bootRun"

group = "<%= packageName %>"
Expand Down

0 comments on commit 407d00f

Please sign in to comment.