diff --git a/build.gradle b/build.gradle index 2214603..eb570e0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.plugins.ide.eclipse.model.AccessRule + apply plugin: 'java' apply plugin: 'eclipse' @@ -34,6 +36,18 @@ ext { lib_spring_boot_mustache='org.springframework.boot:spring-boot-starter-mustache:2.1.2.RELEASE' lib_spring_boot_test='org.springframework.boot:spring-boot-starter-test:2.1.2.RELEASE' lib_spring_boot_web='org.springframework.boot:spring-boot-starter-web:2.1.2.RELEASE' + + eclipseAccessRestrictions = [ + 'org.eclipse.jdt.launching.JRE_CONTAINER': [ + new AccessRule('nonaccessible', 'com/sun/**'), + new AccessRule('nonaccessible', 'java/awt/List'), + new AccessRule('nonaccessible', 'sun/**'), + ], + 'assertj-core': [ + new AccessRule('nonaccessible', 'org/assertj/core/internal/**'), + new AccessRule('nonaccessible', 'org/assertj/core/util/Arrays') + ] + ] } /* @@ -72,6 +86,21 @@ subprojects { dependencies { testCompile group: 'org.testng', name: 'testng', version: '6.14.3' } + + eclipse { + classpath { + file { + whenMerged { + eclipseAccessRestrictions.each{ path, restrictions -> + def container = entries.find { it.path.contains path } + if (container != null) { + container.accessRules.addAll(restrictions) + } + } + } + } + } + } } allprojects {