konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.56k stars 262 forks source link

Building Google Guava #342

Open StarFi55ure opened 6 years ago

StarFi55ure commented 6 years ago

Im trying to build an app with google guava 23.5 as a dependancy. However Im getting a maven build error stating:

Error rendering class com.google.common.cache.LocalCache$Segment. See a cause for details: Can't provide name for method as it was not found: java.util.concurrent.locks.ReentrantLock.<init>()V -> [Help 1]

I looked in the classlib source and find that only some of the java.util.concurrent classes are implemented. Some of the ones that google guava needs are not there.

Is there something special I have to do to get google guava to work?

Just as a test, I tried copying some of the classes from apache harmony project into the classlib module, and rebuilding master from source. But I noticed the classnames in classlib have a T prefix. And I had to disable checkstyle just to get the build to pass. Not sure where to go from here.

konsoletyper commented 6 years ago

Sorry, but ReentrantLock is not supported and there's no easy way to support it, you can't just copy-paste Harmony code, since TeaVM uses cooperative green threads. For now TeaVM supports only simpliest lock possible, i.e. synchronized block. I should refactor the whole lock subsystem to make it possible to implement ReentrantLock without duplication of code.

Looks like you are compiling with 0.5.1, which has unfortunate bug. Compiler throws error instead of reporting error gently. In the latter case compiler would provide more clues what was wrong, what method, direcrtly or indirectly using missing API. So please try 0.6.0-dev-529 (this also requires to specify external Maven repository) and see that TeaVM prints. This would help you to rewrite code to avoid using these API or perhaps patch Guava.

Please, note, that without having your application I can't reproduce the same error, since TeaVM does not process whole classpath. Instead, it just processes methods that are actually used by your code. I don't know whether it's possible to use Guava or not, or what parts of Guava it's safe to use with TeaVM.

StarFi55ure commented 6 years ago

I basically wanted to use the EventBus from guava. It looks to me like EventBus is using classes from com.google.common.cache which in turn uses classes from java.util.concurrent. Ive pasted the output below. I'll try sometime to make a demo app that just creates a single eventbus instance in main, but for now Im just gonna look for an alternative. My app is still in the prototype phase.

Im still learning the java build machinery, so just bear with me :-). I used the version you suggested and got this output from maven. The web module is where my teavm code lives.


┗> mvn package -pl restapi,web
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] restapi
[INFO] web
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building restapi 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ restapi
---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/home/julian/projects/hyperion/core/restapi/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ restapi ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @
restapi ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/home/julian/projects/hyperion/core/restapi/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @
restapi ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ restapi ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ restapi ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building web 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 38 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ web ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- teavm-maven-plugin:0.6.0-SNAPSHOT:compile (web-client) @ web ---
[INFO] Preparing classpath for JavaScript generation
[INFO] Using the following classpath for JavaScript generation:
/home/julian/projects/hyperion/core/restapi/target/restapi-1.0-SNAPSHOT.jar:/home/julian/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/julian/.m2/repository/com/google/dagger/dagger/2.16/dagger-2.16.jar:/home/julian/.m2/repository/com/google/dagger/dagger-compiler/2.16/dagger-compiler-2.16.jar:/home/julian/.m2/repository/com/google/dagger/dagger-producers/2.16/dagger-producers-2.16.jar:/home/julian/.m2/repository/org/checkerframework/checker-compat-qual/2.3.0/checker-compat-qual-2.3.0.jar:/home/julian/.m2/repository/com/google/dagger/dagger-spi/2.16/dagger-spi-2.16.jar:/home/julian/.m2/repository/com/google/googlejavaformat/google-java-format/1.4/google-java-format-1.4.jar:/home/julian/.m2/repository/com/google/errorprone/javac-shaded/9-dev-r4023-3/javac-shaded-9-dev-r4023-3.jar:/home/julian/.m2/repository/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar:/home/julian/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar:/home/julian/.m2/repository/org/immutables/value/2.5.5/value-2.5.5.jar:/home/julian/.m2/repository/org/immutables/builder/2.5.5/builder-2.5.5.jar:/home/julian/.m2/repository/com/google/guava/guava/23.5-jre/guava-23.5-jre.jar:/home/julian/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar:/home/julian/.m2/repository/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar:/home/julian/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar:/home/julian/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/home/julian/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/home/julian/.m2/repository/org/teavm/teavm-jso/0.6.0-dev-529/teavm-jso-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/teavm/teavm-jso-apis/0.6.0-dev-529/teavm-jso-apis-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/teavm/teavm-classlib/0.6.0-dev-529/teavm-classlib-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/teavm/teavm-platform/0.6.0-dev-529/teavm-platform-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/teavm/teavm-core/0.6.0-dev-529/teavm-core-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/teavm/teavm-interop/0.6.0-dev-529/teavm-interop-0.6.0-dev-529.jar:/home/julian/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/julian/.m2/repository/com/carrotsearch/hppc/0.7.3/hppc-0.7.3.jar:/home/julian/.m2/repository/org/teavm/teavm-jso-impl/0.6.0-dev-529/teavm-jso-impl-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/mozilla/rhino/1.7.7/rhino-1.7.7.jar:/home/julian/.m2/repository/org/teavm/teavm-metaprogramming-api/0.6.0-dev-529/teavm-metaprogramming-api-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/ow2/asm/asm-debug-all/5.2/asm-debug-all-5.2.jar:/home/julian/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/julian/.m2/repository/com/jcraft/jzlib/1.1.3/jzlib-1.1.3.jar:/home/julian/.m2/repository/joda-time/joda-time/2.7/joda-time-2.7.jar:/home/julian/.m2/repository/org/teavm/teavm-metaprogramming-impl/0.6.0-dev-529/teavm-metaprogramming-impl-0.6.0-dev-529.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-widgets/0.1.0/teavm-flavour-widgets-0.1.0.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-templates/0.1.0/teavm-flavour-templates-0.1.0.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-expr/0.1.0/teavm-flavour-expr-0.1.0.jar:/home/julian/.m2/repository/org/antlr/antlr4-runtime/4.6/antlr4-runtime-4.6.jar:/home/julian/.m2/repository/net/htmlparser/jericho/jericho-html/3.3/jericho-html-3.3.jar:/home/julian/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-routing/0.1.0/teavm-flavour-routing-0.1.0.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-regex/0.1.0/teavm-flavour-regex-0.1.0.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-rest/0.1.0/teavm-flavour-rest-0.1.0.jar:/home/julian/.m2/repository/org/teavm/flavour/teavm-flavour-json/0.1.0/teavm-flavour-json-0.1.0.jar:/home/julian/.m2/repository/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.jar:/home/julian/.m2/repository/org/webjars/bootstrap/3.3.7-1/bootstrap-3.3.7-1.jar:/home/julian/.m2/repository/org/webjars/jquery/3.2.1/jquery-3.2.1.jar:/home/julian/.m2/repository/org/webjars/jquery-ui/1.12.1/jquery-ui-1.12.1.jar:/home/julian/.m2/repository/org/webjars/lodash/4.17.4/lodash-4.17.4.jar:/home/julian/.m2/repository/org/webjars/openlayers/4.3.1/openlayers-4.3.1.jar:/home/julian/.m2/repository/org/webjars/vue/2.5.13/vue-2.5.13.jar:/home/julian/.m2/repository/org/webjars/bower/swagger-js/2.1.26/swagger-js-2.1.26.jar:/home/julian/projects/hyperion/core/web/target/classes
[INFO] Building JavaScript file
[INFO] Output file built with errors
[ERROR] Class java.util.concurrent.locks.ReentrantReadWriteLock was not found
    at com.google.common.eventbus.EventBus.<init>(EventBus.java:140)
    at com.google.common.eventbus.EventBus.<init>(EventBus.java:181)
    at com.google.common.eventbus.EventBus.<init>(EventBus.java:171)
    at
org.dyndns.ratel.hyperion.web.MainModule.createEventBus(MainModule.java:22)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.proxyCreateEventBus(MainModule_CreateEventBusFactory.java:34)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.provideInstance(MainModule_CreateEventBusFactory.java:25)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:21)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:8)
    at
org.dyndns.ratel.hyperion.web.DaggerMainComponent.mainViewComponent(DaggerMainComponent.java:44)
    at org.dyndns.ratel.hyperion.web.WebMain.init(WebMain.java:37)
    at org.dyndns.ratel.hyperion.web.WebMain.main(WebMain.java:15)
[ERROR] Class java.util.concurrent.ConcurrentLinkedQueue was not found
    at com.google.common.cache.LocalCache.<init>(LocalCache.java:252)
    at
com.google.common.cache.LocalCache$LocalLoadingCache.<init>(LocalCache.java:4817)
    at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:789)
    at com.google.common.eventbus.EventBus.<clinit>(EventBus.java:121)
    at
org.dyndns.ratel.hyperion.web.MainModule.createEventBus(MainModule.java:22)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.proxyCreateEventBus(MainModule_CreateEventBusFactory.java:34)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.provideInstance(MainModule_CreateEventBusFactory.java:25)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:21)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:8)
    at
org.dyndns.ratel.hyperion.web.DaggerMainComponent.mainViewComponent(DaggerMainComponent.java:44)
    at org.dyndns.ratel.hyperion.web.WebMain.init(WebMain.java:37)
    at org.dyndns.ratel.hyperion.web.WebMain.main(WebMain.java:15)
[ERROR] Class java.util.concurrent.locks.ReentrantLock was not found
    at com.google.common.cache.LocalCache$Segment.<init>(LocalCache.java:2090)
    at com.google.common.cache.LocalCache.createSegment(LocalCache.java:1876)
    at com.google.common.cache.LocalCache.<init>(LocalCache.java:301)
    at
com.google.common.cache.LocalCache$LocalLoadingCache.<init>(LocalCache.java:4817)
    at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:789)
    at com.google.common.eventbus.EventBus.<clinit>(EventBus.java:121)
    at
org.dyndns.ratel.hyperion.web.MainModule.createEventBus(MainModule.java:22)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.proxyCreateEventBus(MainModule_CreateEventBusFactory.java:34)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.provideInstance(MainModule_CreateEventBusFactory.java:25)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:21)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:8)
    at
org.dyndns.ratel.hyperion.web.DaggerMainComponent.mainViewComponent(DaggerMainComponent.java:44)
    at org.dyndns.ratel.hyperion.web.WebMain.init(WebMain.java:37)
    at org.dyndns.ratel.hyperion.web.WebMain.main(WebMain.java:15)
[ERROR] Class java.util.concurrent.ConcurrentLinkedQueue was not found
    at com.google.common.cache.LocalCache$Segment.<init>(LocalCache.java:2102)
    at com.google.common.cache.LocalCache.createSegment(LocalCache.java:1876)
    at com.google.common.cache.LocalCache.<init>(LocalCache.java:301)
    at
com.google.common.cache.LocalCache$LocalLoadingCache.<init>(LocalCache.java:4817)
    at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:789)
    at com.google.common.eventbus.EventBus.<clinit>(EventBus.java:121)
    at
org.dyndns.ratel.hyperion.web.MainModule.createEventBus(MainModule.java:22)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.proxyCreateEventBus(MainModule_CreateEventBusFactory.java:34)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.provideInstance(MainModule_CreateEventBusFactory.java:25)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:21)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:8)
    at
org.dyndns.ratel.hyperion.web.DaggerMainComponent.mainViewComponent(DaggerMainComponent.java:44)
    at org.dyndns.ratel.hyperion.web.WebMain.init(WebMain.java:37)
    at org.dyndns.ratel.hyperion.web.WebMain.main(WebMain.java:15)
[ERROR] Class java.util.concurrent.atomic.AtomicReferenceArray was not found
    at
com.google.common.cache.LocalCache$Segment.newEntryArray(LocalCache.java:2116)
    at com.google.common.cache.LocalCache$Segment.<init>(LocalCache.java:2094)
    at com.google.common.cache.LocalCache.createSegment(LocalCache.java:1876)
    at com.google.common.cache.LocalCache.<init>(LocalCache.java:301)
    at
com.google.common.cache.LocalCache$LocalLoadingCache.<init>(LocalCache.java:4817)
    at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:789)
    at com.google.common.eventbus.EventBus.<clinit>(EventBus.java:121)
    at
org.dyndns.ratel.hyperion.web.MainModule.createEventBus(MainModule.java:22)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.proxyCreateEventBus(MainModule_CreateEventBusFactory.java:34)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.provideInstance(MainModule_CreateEventBusFactory.java:25)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:21)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:8)
    at
org.dyndns.ratel.hyperion.web.DaggerMainComponent.mainViewComponent(DaggerMainComponent.java:44)
    at org.dyndns.ratel.hyperion.web.WebMain.init(WebMain.java:37)
    at org.dyndns.ratel.hyperion.web.WebMain.main(WebMain.java:15)
[ERROR] Class java.util.concurrent.atomic.AtomicReferenceArray was not found
    at
com.google.common.cache.LocalCache$Segment.initTable(LocalCache.java:2120)
    at com.google.common.cache.LocalCache$Segment.<init>(LocalCache.java:2094)
    at com.google.common.cache.LocalCache.createSegment(LocalCache.java:1876)
    at com.google.common.cache.LocalCache.<init>(LocalCache.java:301)
    at
com.google.common.cache.LocalCache$LocalLoadingCache.<init>(LocalCache.java:4817)
    at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:789)
    at com.google.common.eventbus.EventBus.<clinit>(EventBus.java:121)
    at
org.dyndns.ratel.hyperion.web.MainModule.createEventBus(MainModule.java:22)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.proxyCreateEventBus(MainModule_CreateEventBusFactory.java:34)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.provideInstance(MainModule_CreateEventBusFactory.java:25)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:21)
    at
org.dyndns.ratel.hyperion.web.MainModule_CreateEventBusFactory.get(MainModule_CreateEventBusFactory.java:8)
    at
org.dyndns.ratel.hyperion.web.DaggerMainComponent.mainViewComponent(DaggerMainComponent.java:44)
    at org.dyndns.ratel.hyperion.web.WebMain.init(WebMain.java:37)
    at org.dyndns.ratel.hyperion.web.WebMain.main(WebMain.java:15)
[INFO] Debug information successfully written
[INFO] Source maps successfully written
[INFO] Source files successfully written
[INFO] Classes compiled: 178
[INFO] Methods compiled: 405
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] restapi ............................................ SUCCESS [  0.725 s]
[INFO] web ................................................ FAILURE [  2.372 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.210 s
[INFO] Finished at: 2018-05-22T14:09:07+02:00
[INFO] Final Memory: 48M/547M

This my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>hyperion</artifactId>
        <groupId>org.dyndns.ratel</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <groupId>org.dyndns.ratel.hyperion</groupId>
    <artifactId>web</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <java.version>1.8</java.version>
        <teavm.version>0.6.0-dev-529</teavm.version>
        <flavour.version>0.1.0</flavour.version>
        <jackson.version>2.5.4</jackson.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>teavm-dev</id>
            <url>https://dl.bintray.com/konsoletyper/teavm</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.dyndns.ratel.hyperion</groupId>
            <artifactId>restapi</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

        <dependency>
            <groupId>com.google.dagger</groupId>
            <artifactId>dagger</artifactId>
            <version>2.16</version>
        </dependency>
        <dependency>
            <groupId>com.google.dagger</groupId>
            <artifactId>dagger-compiler</artifactId>
            <version>2.16</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.immutables</groupId>
            <artifactId>value</artifactId>
            <version>2.5.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.immutables</groupId>
            <artifactId>builder</artifactId>
            <version>2.5.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>23.5-jre</version> <!-- or 23.5-android for the Android flavor -->
        </dependency>

        <dependency>
            <groupId>org.teavm</groupId>
            <artifactId>teavm-jso</artifactId>
            <version>${teavm.version}</version>
        </dependency>
        <dependency>
            <groupId>org.teavm</groupId>
            <artifactId>teavm-jso-apis</artifactId>
            <version>${teavm.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.teavm</groupId>
            <artifactId>teavm-classlib</artifactId>
            <version>${teavm.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.teavm</groupId>
            <artifactId>teavm-metaprogramming-impl</artifactId>
            <version>${teavm.version}</version>
        </dependency>

        <dependency>
            <groupId>org.teavm.flavour</groupId>
            <artifactId>teavm-flavour-widgets</artifactId>
            <version>${flavour.version}</version>
        </dependency>
        <dependency>
            <groupId>org.teavm.flavour</groupId>
            <artifactId>teavm-flavour-rest</artifactId>
            <version>${flavour.version}</version>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.fasterxml.jackson.core</groupId>-->
            <!--<artifactId>jackson-annotations</artifactId>-->
            <!--<version>${jackson.version}</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
            <version>3.3.7-1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-ui</artifactId>
            <version>1.12.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>lodash</artifactId>
            <version>4.17.4</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>openlayers</artifactId>
            <version>4.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>vue</artifactId>
            <version>2.5.13</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>swagger-js</artifactId>
            <version>2.1.26</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <!-- Configure TeaVM -->
            <plugin>
                <groupId>org.teavm</groupId>
                <artifactId>teavm-maven-plugin</artifactId>
                <version>0.6.0-SNAPSHOT</version>
                <executions>
                    <execution>
                        <id>web-client</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <!-- Directory where TeaVM should put generated files. This configuration conforms to the settings
                                 of the WAR plugin -->
                            <targetDirectory>${project.build.directory}/classes/static/js</targetDirectory>

                            <!-- Main class, containing static void main(String[]) -->
                            <mainClass>org.dyndns.ratel.hyperion.web.WebMain</mainClass>

                            <!-- Whether TeaVM should produce minified JavaScript. Can reduce JavaScript file size more than
                                 two times -->
                            <minifying>false</minifying>

                            <!-- Whether TeaVM should produce debug information for its built-in debugger -->
                            <debugInformationGenerated>true</debugInformationGenerated>

                            <!-- Whether TeaVM should produce source maps file -->
                            <sourceMapsGenerated>true</sourceMapsGenerated>

                            <!-- Whether TeaVM should also put source files into output directory,
                                 for compatibility with source maps -->
                            <sourceFilesCopied>true</sourceFilesCopied>

                            <!-- Optimization level. Valid values are: SIMPLE, ADVANCED, FULL -->
                            <optimizationLevel>SIMPLE</optimizationLevel>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20.1</version>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
        </plugins>
    </build>
</project>
konsoletyper commented 6 years ago

Looks like you better give up and don't use EventBus. You can write your own, which does not rely on concurrent package, or find an existing single-threaded one.