bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
192 stars 90 forks source link

Openjdk 17 and Spring boot issues #318

Open dspaeth-breuni opened 1 year ago

dspaeth-breuni commented 1 year ago

Hi,

I'm using asset pipeline with openjdk 17.0.3 with the following build.gradle

buildscript {

    dependencies {
        classpath("com.bertramlabs.plugins:asset-pipeline-gradle:4.0.0")
        //optional
        classpath 'com.bertramlabs.plugins:sass-dart-asset-pipeline:4.0.0'
        classpath 'com.bertramlabs.plugins:typescript-asset-pipeline:4.0.0'
    }
}

plugins {
    id 'java'
    id 'org.springframework.boot' version '2.7.6'
    id 'io.spring.dependency-management' version '1.0.15.RELEASE'
    id 'org.asciidoctor.convert' version '1.5.8'

    id "com.bertramlabs.asset-pipeline" version "3.4.4"
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

apply plugin: 'asset-pipeline'
apply plugin: 'groovy'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

ext {
    set('snippetsDir', file("build/generated-snippets"))
}

assets {
    minifyJs = true
    minifyCss = true
    enableSourceMaps = true
    maxThreads = 4 //useful for concurrent asset processing during build
    configOptions = [:] //useful for custom config on extension libraries

    minifyOptions = [
            optimizationLevel: 'SIMPLE',
            angularPass: true // Can use @ngInject annotation for Angular Apps
    ]

    includes = []
    excludes = ['**/*.less'] //Example Exclude GLOB pattern

    //for plugin packaging
    packagePlugin=false //set to true if this is a library

    //developmentRuntime can be turned off
    developmentRuntime=true

    //if you want to customize the jar task this task runs on you can specify a jarTaskName
    jarTaskName=null

    // Can add custom asset locations (directories or individual jar files)
    from '/vendor/lib'
    from '/path/to/file.jar'
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'
    // implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.flywaydb:flyway-core'
    // implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'com.h2database:h2'
    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
    // testImplementation 'org.springframework.security:spring-security-test'

    // Asset pipeline

    implementation 'org.slf4j:log4j-over-slf4j:2.0.3'
    implementation 'org.codehaus.groovy:groovy-all:2.0.7'
    implementation 'com.bertramlabs.plugins:asset-pipeline-spring-boot:4.0.0'
    implementation 'com.bertramlabs.plugins:sass-dart-asset-pipeline:4.0.0'
    implementation 'com.bertramlabs.plugins:typescript-asset-pipeline:4.0.0'

    compileOnly 'org.webjars.npm:dayjs:1.11.6'
}

tasks.named('test') {
    outputs.dir snippetsDir
    useJUnitPlatform()
}

tasks.named('asciidoctor') {
    inputs.dir snippetsDir
    dependsOn test
}

when I try to start the application within intelij I need to set a lot of jvm --add-opens args

--add-opens
java.base/java.util=ALL-UNNAMED
--add-opens
java.base/java.util.regex=ALL-UNNAMED
--add-opens
java.base/java.lang=ALL-UNNAMED
--add-opens
java.base/java.io=ALL-UNNAMED
--add-opens
java.base/java.security=ALL-UNNAMED
--add-opens
java.base/sun.security.util=ALL-UNNAMED
--add-opens
java.base/java.net=ALL-UNNAMED
--add-opens
java.base/java.lang.reflect=ALL-UNNAMED
--add-opens
java.base/jdk.internal.loader=ALL-UNNAMED
--add-opens
java.base/java.util.jar=ALL-UNNAMED
--add-opens
java.base/java.util.zip=ALL-UNNAMED
--add-opens
java.logging/java.util.logging=ALL-UNNAMED

Is there a better way to get rid of all the error messages ala

Unable to make private java.util.Properties(java.util.Properties,int) accessible: module java.base does not "opens java.util" to unnamed module @703580bf

or to get a complete list of needed --add-opens?