micronaut-examples icon indicating copy to clipboard operation
micronaut-examples copied to clipboard

Add CLI app using Java Modules -- requires Java 11

Open msgilligan opened this issue 6 years ago • 3 comments
trafficstars

Add a CLI app example using Java Modules

Use the org.javamodularity.moduleplugin Gradle plugin (which requires Java 11)

Does not work with Micronaut 1.1.0:

./gradlew clean run

> Configure project :
Found module name 'cli.app.modular.java'

> Task :compileJava FAILED
error: the unnamed module reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.configuration.picocli reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.validation reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.http reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.aop reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.core reads package javax.annotation from both java.annotation and jsr305
error: module slf4j.api reads package javax.annotation from both java.annotation and jsr305
error: module java.validation reads package javax.annotation from both java.annotation and jsr305
error: module com.fasterxml.jackson.datatype.jdk8 reads package javax.annotation from both java.annotation and jsr305
error: module com.fasterxml.jackson.datatype.jsr310 reads package javax.annotation from both java.annotation and jsr305
error: module com.fasterxml.jackson.databind reads package javax.annotation from both java.annotation and jsr305
error: module io.reactivex.rxjava2 reads package javax.annotation from both java.annotation and jsr305
error: module java.annotation reads package javax.annotation from both java.annotation and jsr305
error: module javax.inject reads package javax.annotation from both java.annotation and jsr305
error: module snakeyaml reads package javax.annotation from both java.annotation and jsr305
error: module com.fasterxml.jackson.annotation reads package javax.annotation from both java.annotation and jsr305
error: module com.fasterxml.jackson.core reads package javax.annotation from both java.annotation and jsr305
error: module org.reactivestreams reads package javax.annotation from both java.annotation and jsr305
error: module jsr305 reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.inject reads package javax.annotation from both java.annotation and jsr305
error: module info.picocli reads package javax.annotation from both java.annotation and jsr305
error: module io.micronaut.runtime reads package javax.annotation from both java.annotation and jsr305
/Users/sean/git/micronaut-examples/cli-app-modular-java/src/main/java/module-info.java:1: error: module cli.app.modular.java reads package javax.annotation from both java.annotation and jsr305
module cli.app.modular.java {
^
23 errors

msgilligan avatar May 06 '19 18:05 msgilligan

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 06 '19 18:05 CLAassistant

ee2b20c5eccf038d98be27e80fdda8eb519da51c fixes the split package problem.

Note: There are still some conflicts between shadow plugin and module plugin and between picocli and application plugin run task.

msgilligan avatar May 06 '19 22:05 msgilligan

It might be considered to remove the shadow plugin: https://github.com/micronaut-projects/micronaut-examples/issues/9

benmccann avatar Apr 27 '20 12:04 benmccann