intelliJ를 사용해서 프로젝트 시작 중 아래와 같은 에러가 발생했을때

CreateProcess error=206, 파일 이름이나 확장명이 너무 깁니다

아래와 같은 플러그 인으로 해결

요약

문제 원인 :

gradle 에서 java를 실행할때, commandline으로 실행을 하는데, classpath의 길이가 너무 길어서 발생

이것을 manifest jar로 만들어서 실행해줌


gradle-util-plugins

When classpath for a Gradle JavaExec task is long, Windows command executions give error because of limitation to command line length greater than 32K.

With a number of classpath dependencies in a large project, typically JavaExec Gradle task fails with error "The filename or extension is too long" and this would be a stopping error. To solve this issue, use ManifestClasspath plugin.

ManifestClasspath plugin creates a manifest jar for jar files in the classpath of JavaExec task and sets the classpath with manifest jar.

Usage

To use the plugin, define a dependency in build script and have plugin entry in Gradle project.

build.gradle snippet to use ManifestClasspath plugin

Build script snippet for plugins DSL for Gradle 2.1 and later

plugins {
  id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}

Build script snippet for use in older Gradle versions or where dynamic configuration is required

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE"
  }
}

apply plugin: "com.github.ManifestClasspath"

https://github.com/viswaramamoorthy/gradle-util-plugins

'BackEnd > ETC' 카테고리의 다른 글

Git remote: Permission to  (0) 2020.03.08
http 상태 코드  (0) 2020.01.19
CQRS란 ?  (1) 2020.01.19
STORM 정리  (0) 2017.12.18

+ Recent posts