cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.45k stars 160 forks source link

Need help in making candy of a pure java library #652

Closed evanvelikanov closed 3 years ago

evanvelikanov commented 3 years ago

Hi

I have made a java dsl for html which is supposed to be javascript compatible. It compiles to js without any issues, I am using ES6. However I am not able to use this in any other jsweet project. Here is the project hosted, I just pushed it a while back just for getting clarity in this https://github.com/xyz-jphil/xyz-jphil-luvml

I am getting the following error message (several times)

ERROR output:55 - [ts] Cannot find name 'luvml'. at ....

Somewhere I think I am messing the pom configuration for making it into a candy. Here is the pom of the candy - xyz-jphil-luvml. https://github.com/xyz-jphil/xyz-jphil-luvml/blob/master/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>
    <groupId>io.github.xyz-jphil</groupId>
    <artifactId>xyz-jphil-luvml</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

        <jsweet.transpiler.version>3.0.0</jsweet.transpiler.version> <!-- Released on 2020-12-17  -->
        <jsweet.core.version>6.3.0</jsweet.core.version> <!-- as per 2020-12-16 from https://github.com/cincheo/jsweet-quickstart/blob/master/pom.xml -->
        <java.version.release>11</java.version.release>
        <java.version>1.${java.version.release}</java.version>
        <jstargetVersion>ES6</jstargetVersion> <!--https://developers.google.com/apps-script/guides/v8-runtime -->
    </properties>
    <name>xyz-jphil-luvml</name>
    <description>Luvml is a way to Love Html (and XML). It is a Html DSL compatible with normal Java and Javascript (using JSweet v3)</description>
    <url>https://github.com/xyz-jphil/xyz-jphil-patterns-lambda</url>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Ivan Velikanova</name>
            <email>ivan.velikanova@gmail.com</email>
            <organization>xyz-jphil</organization>
            <organizationUrl>https://github.com/xyz-jphil</organizationUrl>
        </developer>
    </developers>

    <!-- JSweet specific start { -->
    <!-- <dependencies>
        <dependency>
            <groupId>org.jsweet</groupId>
            <artifactId>jsweet-core</artifactId>
            <version>${jsweet.core.version}</version>
        </dependency>
    </dependencies> -->
    <pluginRepositories>
        <pluginRepository>
            <id>jsweet-plugins-release</id>
            <name>plugins-release</name>
            <url>http://repository.jsweet.org/artifactory/plugins-release-local</url>
        </pluginRepository>
        <pluginRepository>
            <snapshots />
            <id>jsweet-plugins-snapshots</id>
            <name>plugins-snapshot</name>
            <url>http://repository.jsweet.org/artifactory/plugins-snapshot-local</url>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>jsweet-central</id>
            <name>libs-release</name>
            <url>http://repository.jsweet.org/artifactory/libs-release-local</url>
        </repository>
        <repository>
            <snapshots />
            <id>jsweet-snapshots</id>
            <name>libs-snapshot</name>
            <url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
        </repository>
    </repositories>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>${java.version.release}</release>
                    <compilerVersion>${java.version}</compilerVersion>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>           
            <plugin>
                <groupId>org.jsweet</groupId>
                <artifactId>jsweet-maven-plugin</artifactId>
                <version>${jsweet.transpiler.version}</version>
                <configuration>
                    <verbose>true</verbose>
                    <bundle>true</bundle>
                    <!-- <tsOut>src/main/resources/src/typings/${project.artifactId}/${project.version}</tsOut>
                    <outDir>target/js</outDir> -->
                    <declaration>true</declaration>
                    <outDir>src/main/resources/META-INF/resources/webjars/${project.artifactId}/${project.version}</outDir>
                    <dtsOut>src/main/resources/src/typings/${project.artifactId}/${project.version}</dtsOut>            
                    <encoding>UTF-8</encoding>                    
                    <targetVersion>${jstargetVersion}</targetVersion>                     
                    <module>none</module>
                    <moduleResolution>classic</moduleResolution>    
                </configuration>
                <executions>
                    <execution>
                        <id>generate-js</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>jsweet</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>   
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <echo message="copying generated bundles to dist..." />
                                <mkdir dir="target/dist/"></mkdir>
                                <copy
                                    file="target/js/bundle.js"
                                    tofile="target/dist/${project.artifactId}.js" verbose="true"
                                    failonerror="false" />
                                <copy
                                    file="target/ts/bundle.d.ts"
                                    tofile="target/dist/${project.artifactId}.d.ts" verbose="true"
                                    failonerror="false" />
                                <echo message="copying JavaScript lib to resources..." />
                                <!-- <copy file="bower_components/sprintf/dist/sprintf.min.js"
                                        tofile="src/main/resources/META-INF/resources/webjars/${project.artifactId}/${project.version}/bundle.js"
                                        verbose="true" /> -->
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <javadocVersion>1.8</javadocVersion>
                    <sourcepath>src/main/java</sourcepath>
                    <skip>${skipJavadoc}</skip>
                    <encoding>UTF-8</encoding>
                    <fixTags>all</fixTags>
                    <failOnError>false</failOnError>
                    <!-- leave these options unchanged to place the Javadoc at the right place for jsweet.org -->
                    <reportOutputDirectory>/var/www/apidocs/releases/org/jsweet/candies</reportOutputDirectory>
                    <destDir>${project.artifactId}/${project.version}</destDir>
                    <!-- end of jsweet.org configuration -->
                    <header><![CDATA[<a href="http://www.jsweet.org" target="_blank" style="text-transform: lowercase">http://www.jsweet.org<a>]]></header>
                    <bottom><![CDATA[<center>Copyright 2015, <a href="http://www.cincheo.org" target="_blank">Cinchéo SAS<a> - Web site: <a href="http://www.jsweet.org" target="_blank">http://www.jsweet.org<a><center>]]></bottom>
                    <stylesheetfile>/var/www/apidocs/stylesheet.css</stylesheetfile>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <!-- } End of JSweet Specific -->
    <!-- Maven OSSRH Specifiec -->
    <scm>
        <connection>scm:git:git://github.com/xyz-jphil/xyz-jphil-patterns-lambda.git</connection>
        <developerConnection>scm:git:ssh://github.com:xyz-jphil/xyz-jphil-patterns-lambda.git</developerConnection>
        <url>http://github.com/simpligility/ossrh-demo/tree/master</url>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <profiles>
        <profile> 
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <configuration>
                            <source>8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Update 1 : I think i omitted tsout as it is not given in the older example. I am trying different ways to fix this.

Update 2 : The <module> was set to none, commented it out, retrying. Update 3 : I just realized that the output ts and js are generating inspite of all the error messages. So I think I will be able to proceed until I am able to fix this.

lgrignon commented 3 years ago

Hello @ivan-velikanova Thanks for reporting.

I understand that you have trouble packaging your candy because JSweet transpilation of its Java code is failing, is that right? If so, what exactly are the errors please (if you have multiple)?

I would say that you get a ERROR output:55 - [ts] Cannot find name 'luvml'. at .... because you are missing a package-info.java, please see https://github.com/jsweet-candies/candy-jquery/blob/master/src/main/java/def/jquery/package-info.java I think your package must start with def. ==> dev.luvml should work better

evanvelikanov commented 3 years ago

Thank you so much for your response. I am not sure if I understand if you understood my problem correctly. Both the java part and js part of the code compiles perfectly fine, there is no problem. The problem in compilation appear only when I use this candy some place else. And even with errors somehow it is giving output. This is how I have been able to manage.

The only error which I get is ERROR output:55 - [ts] Cannot find name 'luvml'. at .... The line numbers change, and basically anywhere I have used luvml, I get errors.

I have purposely omitted to place this module as a sub-package in def , because JSweet transpiler doesn't work at all once luvml is placed inside def package, it treats it differently. I get such errors:

2021-01-01 21:53:42.042 ERROR output:55 - method 'render' cannot define a body in interface 'Out_String' (try 'abstract' or 'native' modifiers) at xyz-jphil-luvml_def\src\main\java\def\luvml\o\Out_String.java(17)

I added package-info annotation, it doesn't seem to change anything. I did get a message something like one candy detected. Also when I applied the root package on luvml it didn't work at all. To me it seemed that it was confusing my package names (which are intentionally very short) as class variable names. When I applied the root package to the java root package it atleast compiled. But when I used the module in some other maven jsweet project I am getting the same error as earlier.

Luvml is not a JS library which is being wrapped as a candy, it is a pure java library, used both in java and intended to be compatible with Javascript (Google app script) also. It is like my take on JSX without leaving Java.

image

lgrignon commented 3 years ago

Okay, I wasn't sure about wether the problem was in the candy project itself or in the client project. It's clearer now, thanks. It's definitively supposed to work, I have done this dozen of times, let's dig into this together.

You are right, if your candy is pure Java/JSweet code, we should not put sources in def.* which is dedicated to API declarations. I am not sure the package-info.java will help either, for now.

I think the best we can do for now is to check that the generated candy has the expected structure: The JAR resolved by maven in your client project should include JS code in META-INF/resources/webjars///bundle.js and TS declarations (which seems missing for us) in META-INF/resources/typings///bundle.d.ts

For instance, the J4TS candy has those files: http://repository.jsweet.org/artifactory/webapp/#/artifacts/browse/tree/General/libs-release-local/org/jsweet/j4ts/2.0.0/j4ts-2.0.0.jar!/META-INF/resources/webjars/j4ts/2.0.0/ http://repository.jsweet.org/artifactory/webapp/#/artifacts/browse/tree/General/libs-release-local/org/jsweet/j4ts/2.0.0/j4ts-2.0.0.jar!/META-INF/resources/typings/j4ts/2.0.0/

Next:

evanvelikanov commented 3 years ago

Wow, what a precise guidance and friendliness, I feel very grateful, thank you. However I will be able to try this a couple of days later only, but I will surely do and post the results here. And most positively I will be able to get this working I think. I am sure, the candy structure is messed up, because I did weird things with the pom. With that alone I feel it will work.

Thanks again Ivan

evanvelikanov commented 3 years ago

Update 1 : I had seen the d.ts files being generated, and did not bother to look inside, but now only I realized they are empty (70 bytes of jsweet header signature). Exploring the reason and hope to be able to address this part. Then will retry and update here.

Update 2: I had to add these two options in the pom (adding in detail for benefit of others)

<!-- pom structure as usual -->
    <build>
        <plugins>
            <!-- other plugins as usual -->
            <plugin>
                <groupId>org.jsweet</groupId>
                <artifactId>jsweet-maven-plugin</artifactId>
                <version>${jsweet.transpiler.version}</version>
                <configuration>
                    <!-- other options as usual -->
                    <declaration>true</declaration>
                    <dtsOut>target/ts</dtsOut>
                </configuration>
<!-- continued -->

to force/enable generation of the d.ts without these only a simple comment was appearing in the generated d.ts file. Just settings <declaration>true</declaration> also did not work, both had to be used. I don't know the reason. And I don't know how it is working in J4TS without using these flags.

Update 3: The d.ts file is properly generating, but still not able to get the client maven project compile.

Update 4: Extracted candies directory seems to be null, I think candies are not getting extracted.

2021-01-09 05:37:09.009 INFO  CandyProcessor:138 - extracted candies directory is set to default
2021-01-09 05:37:09.009 INFO  CandyProcessor:141 - extracted candies directory: null

Update 5: I am not having such a configuration file https://github.com/cincheo/jsweet-examples/blob/d26489d8c86b9191a8f7b91e033efc790d6330b2/local.properties in the client maven project, I wonder if that is making any difference. This one specifies

env.transpiler.candiesJsOut=${env.build.dir}/candies

Update 6: The candy is not getting detected in the client. It was showing as 1 candy detected, that happens to be jsweet-core. Exploring the problem.

Update 7: @lgrignon had mentioned that the structure of the candy should like this

META-INF/resources/typings///bundle.d.ts META-INF/resources/typings///bundle.d.ts

My candy's jar looks like this :

xyz-jphil-luvml-1.1.jar/META-INF/resources/typings/xyz-jphil-luvml/1.1/bundle.d.ts
xyz-jphil-luvml-1.1.jar/META-INF/resources/typings/xyz-jphil-luvml/1.1/bundle.ts
xyz-jphil-luvml-1.1.jar/META-INF/resources/webjars/xyz-jphil-luvml/1.1/bundle.js

I don't know if he had left the /// to indicate precisely this inclusion of version

evanvelikanov commented 3 years ago

Update 8: I tried this for a couple of hours and it doesn't seem to work. So I have provided the pom files of the candy and the pom of the project using the pom

I spent a good bunch of time on this, and might not be able to spend more time on this right now. :(

@lgrignon Kindly guide.

(1) POM of the candy

<?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>
    <groupId>io.github.xyz-jphil</groupId>
    <artifactId>xyz-jphil-luvml</artifactId>
    <version>1.1</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <jsweet.transpiler.version>3.0.0</jsweet.transpiler.version>
        <jsweet.core.version>6.3.0</jsweet.core.version>
        <java.version.release>11</java.version.release>
        <java.version>1.${java.version.release}</java.version>
        <jstargetVersion>ES6</jstargetVersion> <!--https://developers.google.com/apps-script/guides/v8-runtime -->
    </properties>
    <name>xyz-jphil-luvml</name>
    <description>Luvml is a way to Love Html (and XML). It is a Html DSL compatible with normal Java and Javascript (using JSweet v3)</description>
    <url>https://github.com/xyz-jphil/${project.artifactId}</url>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Ivan Velikanova</name>
            <email>ivan.velikanova@gmail.com</email>
            <organization>xyz-jphil</organization>
            <organizationUrl>https://github.com/xyz-jphil</organizationUrl>
        </developer>
    </developers>

    <!-- JSweet specific start { -->
    <dependencies>
        <dependency>
            <groupId>org.jsweet</groupId>
            <artifactId>jsweet-core</artifactId>
            <version>${jsweet.core.version}</version>
        </dependency>
    </dependencies>
    <pluginRepositories>
        <pluginRepository>
            <id>jsweet-plugins-release</id>
            <name>plugins-release</name>
            <url>http://repository.jsweet.org/artifactory/plugins-release-local</url>
        </pluginRepository>
        <pluginRepository>
            <snapshots />
            <id>jsweet-plugins-snapshots</id>
            <name>plugins-snapshot</name>
            <url>http://repository.jsweet.org/artifactory/plugins-snapshot-local</url>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>jsweet-central</id>
            <name>libs-release</name>
            <url>http://repository.jsweet.org/artifactory/libs-release-local</url>
        </repository>
        <repository>
            <snapshots />
            <id>jsweet-snapshots</id>
            <name>libs-snapshot</name>
            <url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
        </repository>
    </repositories>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>${java.version.release}</release>
                    <compilerVersion>${java.version}</compilerVersion>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <!-- <fork>true</fork> --> <!-- not there in the non-candy quickstart, not there is example cited also. TODO : REMOVE -->
                </configuration>
            </plugin>           
            <plugin>
                <groupId>org.jsweet</groupId>
                <artifactId>jsweet-maven-plugin</artifactId>
                <version>${jsweet.transpiler.version}</version>
                <configuration>
                    <verbose>true</verbose>
                    <sourceMap>false</sourceMap> <!-- in J4TS -->
                    <bundle>true</bundle> <!-- Not there in J4TS, withou this bundle.js might not happen -->
                    <!-- <tsOut>src/main/resources/src/typings/${project.artifactId}/${project.version}</tsOut> -->
                    <outDir>target/js</outDir> <!-- As per J4TS : TODO : KEEP, remove this comment -->
                    <!-- <declaration>true</declaration> --> <!-- not there in the non-candy quickstart, not there in J4TS, TODO : Remove -->
                    <tsserver>true</tsserver>
                    <!-- <outDir>src/main/resources/META-INF/resources/webjars/${project.artifactId}/${project.version}</outDir> --> <!-- not there in j4ts -->                    
                    <!-- <tsOut>src/main/resources/META-INF/resources/typings/${project.artifactId}/${project.version}</tsOut> --> <!-- TS out not there -->
                    <!-- <encoding>UTF-8</encoding>  --> <!-- not there in j4ts : TODO : REMOVE -->
                    <targetVersion>${jstargetVersion}</targetVersion> <!-- set to ES3 in candy examples, ES6 in J4TS, this is ok, TODO : remove comment -->
                    <!-- <module>none</module>
                    <moduleResolution>classic</moduleResolution> --> <!-- not there in chart.js, not there in J4TS -->
                    <candiesJsOut>target/candies</candiesJsOut> <!-- There in J4TS, TODO: try removing later -->
                    <declaration>true</declaration>
                    <dtsOut>target/ts</dtsOut>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-js</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>jsweet</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>   
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <echo message="copying js files to artifact's JSweet dir" />    
                                <delete dir="src/main/resources/META-INF/resources"></delete>
                                <copy
                                    file="target/js/bundle.js"
                                    tofile="src/main/resources/META-INF/resources/webjars/${project.artifactId}/${project.version}/bundle.js"
                                    verbose="true" />
                                <copy
                                    file="target/ts/bundle.d.ts"
                                    tofile="src/main/resources/META-INF/resources/typings/${project.artifactId}/${project.version}/bundle.d.ts"
                                    verbose="true" />
                                <echo message="copying generated bundles to dist..." />
                                <copy
                                        file="target/js/bundle.js"
                                        tofile="dist/${project.artifactId}.js" verbose="true" />
                                <copy
                                        file="target/ts/bundle.d.ts"
                                        tofile="dist/${project.artifactId}.d.ts" verbose="true" />
                                </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <javadocVersion>1.8</javadocVersion>
                    <sourcepath>src/main/java</sourcepath>
                    <skip>${skipJavadoc}</skip>
                    <encoding>UTF-8</encoding>
                    <fixTags>all</fixTags>
                    <failOnError>false</failOnError>
                    <!-- leave these options unchanged to place the Javadoc at the right place for jsweet.org -->
                    <!-- Since this is a java candy, not following these, TODO : remove these unncessary lines -->
                    <!-- <reportOutputDirectory>/var/www/apidocs/releases/org/jsweet/candies</reportOutputDirectory>
                    <destDir>${project.artifactId}/${project.version}</destDir> -->
                    <!-- end of jsweet.org configuration -->
                    <header><![CDATA[<a href="http://www.jsweet.org" target="_blank" style="text-transform: lowercase">http://www.jsweet.org<a>]]></header>
                    <bottom><![CDATA[<center>Copyright 2015, <a href="http://www.cincheo.org" target="_blank">Cinchéo SAS<a> - Web site: <a href="http://www.jsweet.org" target="_blank">http://www.jsweet.org<a><center>]]></bottom>
                    <stylesheetfile>/var/www/apidocs/stylesheet.css</stylesheetfile>
                </configuration>
                <!-- Disable javadoc for now -->
                <!-- 
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                -->
            </plugin>
        </plugins>
    </build>
    <!-- } End of JSweet Specific -->
    <!-- Maven OSSRH Specifiec -->
    <scm>
        <connection>scm:git:git://github.com/xyz-jphil/${project.artifactId}.git</connection>
        <developerConnection>scm:git:ssh://github.com:xyz-jphil/${project.artifactId}.git</developerConnection>
        <url>http://github.com/simpligility/ossrh-demo/tree/master</url>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <profiles>
        <profile> 
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <configuration>
                            <source>8</source>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>  

(2) POM of the Test Project trying to use the candy

<?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>
    <groupId>io.github.xyz-jphil</groupId>
    <artifactId>xyz-jphil-jsweet_test</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <jsweet.transpiler.version>3.0.0</jsweet.transpiler.version>
        <jsweet.core.version>6.3.0</jsweet.core.version>
        <java.version.release>11</java.version.release>
        <java.version>1.${java.version.release}</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jstargetVersion>ES6</jstargetVersion> 
    </properties>
        <pluginRepositories>
        <pluginRepository>
            <id>jsweet-plugins-release</id>
            <name>plugins-release</name>
            <url>http://repository.jsweet.org/artifactory/plugins-release-local</url>
        </pluginRepository>
        <pluginRepository>
            <snapshots />
            <id>jsweet-plugins-snapshots</id>
            <name>plugins-snapshot</name>
            <url>http://repository.jsweet.org/artifactory/plugins-snapshot-local</url>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>jsweet-central</id>
            <name>libs-release</name>
            <url>http://repository.jsweet.org/artifactory/libs-release-local</url>
        </repository>
        <repository>
            <snapshots />
            <id>jsweet-snapshots</id>
            <name>libs-snapshot</name>
            <url>http://repository.jsweet.org/artifactory/libs-snapshot-local</url>
        </repository>
    </repositories>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>${java.version.release}</release>
                    <compilerVersion>${java.version}</compilerVersion>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.jsweet</groupId>
                <artifactId>jsweet-maven-plugin</artifactId>
                <version>${jsweet.transpiler.version}</version>
                <configuration>
                    <verbose>true</verbose>
                    <bundle>true</bundle>
                    <tsOut>target/ts</tsOut>
                    <outDir>target/js</outDir>
                    <candiesJsOut>target/candies</candiesJsOut>
                    <encoding>UTF-8</encoding>
                    <noRootDirectories>false</noRootDirectories>
                    <targetVersion>${jstargetVersion}</targetVersion>                     
                </configuration>
                <executions>
                    <execution>
                        <id>generate-js</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>jsweet</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>   
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <echo message="copying generated bundles to dist..." />
                                <mkdir dir="dist/"></mkdir>
                                <copy
                                    file="src/main/resources/META-INF/resources/typings/${project.artifactId}/${project.version}/bundle.d.ts"
                                    tofile="dist/${project.artifactId}.d.ts" verbose="true"
                                    failonerror="false" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <phase>deploy</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>io.github.xyz-jphil</groupId>
            <artifactId>xyz-jphil-luvml</artifactId>
            <version>1.1</version>
        </dependency>
    </dependencies>
</project>

(3) The source code of a simple file in the test project

package xyz.jphil.jsweet_test;

import luvml.e.N_Text;
import static luvml.e.N_Text.text;

public class Main {
    public static void main(String[] args) {
        N_Text text = text("");
    }
}

(4) The error message when trying to build

cd \xyz-jphil-js\xyz-jphil-jsweet_test; "JAVA_HOME=C:\\Program Files\\Java\\jdk-11.0.2" M2_HOME=F:\\utilities\\maven cmd /c "\"F:\\utilities\\maven\\bin\\mvn.cmd\" -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans-12.2\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 install"
Scanning for projects...

-------------< io.github.xyz-jphil:xyz-jphil-jsweet_test >--------------
Building xyz-jphil-jsweet_test 1.0
--------------------------------[ jar ]---------------------------------

--- jsweet-maven-plugin:3.0.0:jsweet (generate-js) @ xyz-jphil-jsweet_test ---
maven version: 3.6.3
JSweet transpiler version 3.0.0 (build date: 2020-12-16 07:35:57)
dependencies=[Dependency {groupId=io.github.xyz-jphil, artifactId=xyz-jphil-luvml, version=1.1, type=jar}]
candies detection: add project dependency Dependency {groupId=io.github.xyz-jphil, artifactId=xyz-jphil-luvml, version=1.1, type=jar} => io.github.xyz-jphil:xyz-jphil-luvml:jar:1.1:compile
all candies artifacts: [io.github.xyz-jphil:xyz-jphil-luvml:jar:1.1:compile (1; enabled), org.jsweet:jsweet-core:jar:6.3.0:compile (2; enabled)]
candies jars: [C:\Users\Ivan\.m2\repository\io\github\xyz-jphil\xyz-jphil-luvml\1.1\xyz-jphil-luvml-1.1.jar, C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar]
classpath from maven: C:\Users\Ivan\.m2\repository\io\github\xyz-jphil\xyz-jphil-luvml\1.1\xyz-jphil-luvml-1.1.jar;C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar
jsOut: \xyz-jphil-js\xyz-jphil-jsweet_test\target\js
bundle: true
tsOut: \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts
tsOnly: null
tsserver: true
declarations: null
ignoreDefinitions: null
declarationOutDir: null
candiesJsOutDir: \xyz-jphil-js\xyz-jphil-jsweet_test\target\candies
ecmaTargetVersion: ES6
moduleKind: null
sourceMap: null
sourceRoot: null
compileSourceRootsOverridenull
verbose: true
veryVerbose: null
jdkHome: C:\Program Files\Java\jdk-11.0.2
factoryClassName: null
ignoredProblems: null
extraSystemPath: null
2021-01-09 06:37:52.052 INFO  JSweetTranspiler:414 - no configuration file found at \xyz-jphil-js\xyz-jphil-jsweet_test\jsweetconfig.json
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:519 - creating transpiler version 3.0.0 (build date: 2020-12-16 07:35:57)
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:521 - current dir: \xyz-jphil-js\xyz-jphil-jsweet_test\.
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:522 - base directory: \xyz-jphil-js\xyz-jphil-jsweet_test
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:523 - working directory: \xyz-jphil-js\xyz-jphil-jsweet_test\.jsweet
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:524 - tsOut: \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts - \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:525 - jsOut: \xyz-jphil-js\xyz-jphil-jsweet_test\target\js - \xyz-jphil-js\xyz-jphil-jsweet_test\target\js
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:526 - candyJsOut: \xyz-jphil-js\xyz-jphil-jsweet_test\target\candies
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:527 - factory: org.jsweet.transpiler.JSweetFactory@6f139fc9
2021-01-09 06:37:53.053 DEBUG JSweetTranspiler:528 - compile classpath: \xyz-jphil-js\xyz-jphil-jsweet_test\jsweet_extension;C:\Users\Ivan\.m2\repository\io\github\xyz-jphil\xyz-jphil-luvml\1.1\xyz-jphil-luvml-1.1.jar;C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar
2021-01-09 06:37:53.053 DEBUG JSweetTranspiler:529 - runtime classpath: F:\utilities\maven\bin\..\boot\plexus-classworlds-2.6.0.jar
2021-01-09 06:37:53.053 DEBUG JSweetTranspiler:530 - extension directory: \xyz-jphil-js\xyz-jphil-jsweet_test\jsweet_extension
2021-01-09 06:37:53.053 INFO  CandyProcessor:123 - candies processor classpath: \xyz-jphil-js\xyz-jphil-jsweet_test\jsweet_extension;C:\Users\Ivan\.m2\repository\io\github\xyz-jphil\xyz-jphil-luvml\1.1\xyz-jphil-luvml-1.1.jar;C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar
2021-01-09 06:37:53.053 INFO  CandyProcessor:141 - extracted candies directory: \xyz-jphil-js\xyz-jphil-jsweet_test\target\candies
source includes: {}
source excludes: {}
sources paths: [\xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java]
sources paths from resources: [\xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java]
sourceFiles=[\xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java, \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\package-info.java]
2021-01-09 06:37:53.053 DEBUG ProcessUtil:67 - extra path: 
2021-01-09 06:37:53.053 DEBUG ProcessUtil:304 - run command: cmd /c node --version
2021-01-09 06:37:53.053 DEBUG ProcessUtil:319 - started [cmd, /c, node, --version]
2021-01-09 06:37:53.053 INFO  JSweetTranspiler:552 - node version: v12.16.1
2021-01-09 06:37:53.053 INFO  CandyProcessor:226 - 1 candies found in classpath
2021-01-09 06:37:53.053 INFO  CandyProcessor:168 - candies changed, processing candies: CandyStore=[(jsweet-core-6.3.0,t=1608036294000)]
2021-01-09 06:37:53.053 INFO  CandyProcessor:295 - extract candy: C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar javaOutputDirectory=\xyz-jphil-js\xyz-jphil-jsweet_test\.jsweet\candies\src\jsweet-core-6.3.0 tsDefOutputDirectory=\xyz-jphil-js\xyz-jphil-jsweet_test\.jsweet\candies\typings jsOutputDir=\xyz-jphil-js\xyz-jphil-jsweet_test\target\candies\jsweet-core-6.3.0
2021-01-09 06:37:53.053 DEBUG JavaCompilationComponents:104 - charset: UTF-8
2021-01-09 06:37:53.053 DEBUG JavaCompilationComponents:105 - strict mode: false
2021-01-09 06:37:53.053 INFO  JavaCompilationComponents:116 - creating JavaCompiler task with options: JavaCompilerOptions: [--module-path, \xyz-jphil-js\xyz-jphil-jsweet_test\jsweet_extension;C:\Users\Ivan\.m2\repository\io\github\xyz-jphil\xyz-jphil-luvml\1.1\xyz-jphil-luvml-1.1.jar;C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar, -cp, \xyz-jphil-js\xyz-jphil-jsweet_test\jsweet_extension;C:\Users\Ivan\.m2\repository\io\github\xyz-jphil\xyz-jphil-luvml\1.1\xyz-jphil-luvml-1.1.jar;C:\Users\Ivan\.m2\repository\org\jsweet\jsweet-core\6.3.0\jsweet-core-6.3.0.jar, -Xlint:path, -encoding, UTF-8]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jsweet.transpiler.util.Util$JavacInternals (file:/C:/Users/Ivan/.m2/repository/org/jsweet/jsweet-transpiler/3.0.0/jsweet-transpiler-3.0.0.jar) to field com.sun.tools.javac.model.JavacTypes.types
WARNING: Please consider reporting this to the maintainers of org.jsweet.transpiler.util.Util$JavacInternals
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-01-09 06:37:55.055 DEBUG JSweetTranspiler:1070 - ordered compilation units: [\xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java, \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\package-info.java]
2021-01-09 06:37:55.055 DEBUG JSweetTranspiler:1073 - count: 2 (initial), 2 (ordered)
2021-01-09 06:37:55.055 DEBUG JSweetTranspiler:1081 - permutation: 0=0;1=1;
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:1129 - scanning \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java...
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:1129 - scanning \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\package-info.java...
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:1154 - creating bundle file: \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.ts
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:1211 - created \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.ts
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:1154 - creating bundle file: \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.d.ts
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:1211 - created \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.d.ts
2021-01-09 06:37:55.055 INFO  JSweetTranspiler:850 - ts2js on org.jsweet.transpiler.TypeScript2JavaScriptWithTsserverTranspiler@5c7dfc05 sourceFiles=2
2021-01-09 06:37:55.055 DEBUG TypeScript2JavaScriptWithTsserverTranspiler:47 - ts2js with tsserver: [\xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.ts]
2021-01-09 06:37:55.055 INFO  TypeScript2JavaScriptWithTsserverTranspiler:75 - launching tsserver compilation : 
compilerOptions=ts.cmd.tsc.CompilerOptions@7102ac3e 
sourcesFilePaths=[/xyz-jphil-js/xyz-jphil-jsweet_test/target/ts/bundle.ts]
2021-01-09 06:37:55.055 INFO  TypeScript2JavaScriptWithTsserverTranspiler:173 - creating TypeScriptServiceClient
2021-01-09 06:37:55.055 DEBUG TypeScript2JavaScriptWithTsserverTranspiler:78 - tsserver client built
2021-01-09 06:37:55.055 INFO  TypeScript2JavaScriptWithTsserverTranspiler:83 - open external project: /xyz-jphil-js/xyz-jphil-jsweet_test/target/ts
2021-01-09 06:37:56.056 DEBUG TypeScript2JavaScriptWithTsserverTranspiler:89 - tsserver project opened: /xyz-jphil-js/xyz-jphil-jsweet_test/target/ts
2021-01-09 06:37:59.059 INFO  TypeScript2JavaScriptWithTsserverTranspiler:107 - tsserver project compiled: /xyz-jphil-js/xyz-jphil-jsweet_test/target/ts
2021-01-09 06:38:02.002 ERROR TypeScript2JavaScriptWithTsserverTranspiler:120 - TypeScript error: [ts] Cannot find namespace 'luvml'. at \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.ts(4)
2021-01-09 06:38:02.002 ERROR output:55 - [ts] Cannot find namespace 'luvml'. at \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java(8)
2021-01-09 06:38:02.002 ERROR TypeScript2JavaScriptWithTsserverTranspiler:120 - TypeScript error: [ts] Cannot find name 'luvml'. at \xyz-jphil-js\xyz-jphil-jsweet_test\target\ts\bundle.ts(4)
2021-01-09 06:38:02.002 ERROR output:55 - [ts] Cannot find name 'luvml'. at \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java(8)
2021-01-09 06:38:02.002 INFO  JSweetTranspiler:834 - transpilation process finished in 9129 ms 
> java2ts: 2011.3649ms
> ts2js: 6689.6011ms

transpilation failed
org.apache.maven.plugin.MojoFailureException: transpilation failed with 2 error(s) and 0 warning(s)

=========================================
TRANSPILATION ERRORS SUMMARY:
* \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java(8,23)[ts] Cannot find namespace 'luvml'.
* \xyz-jphil-js\xyz-jphil-jsweet_test\src\main\java\xyz\jphil\jsweet_test\Main.java(8,28)[ts] Cannot find name 'luvml'.

=========================================
    at org.jsweet.AbstractJSweetMojo.transpile (AbstractJSweetMojo.java:694)
    at org.jsweet.JSweetMojo.execute (JSweetMojo.java:43)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
lgrignon commented 3 years ago

Hello @ivan-velikanova Thanks for your tenacity on this :) I created a PR which fixes your configuration, it should be ok now: https://github.com/xyz-jphil/xyz-jphil-luvml/pull/1 I successfully transpiled a main with your example code.

It's better to start from the java candy example https://github.com/lgrignon/jsweet-candy-example or use the candy generator https://github.com/cincheo/jsweet/blob/develop/candy-generator, because creating a candy project from scratch is more complicated.

Anyway it should work now. Please tell me if you have more errors at runtime because I did not have enough time to test.

If your candy is meant to be shared, I recommend that you integrate it into the following organization, if ok for you: https://github.com/jsweet-candies/

evanvelikanov commented 3 years ago

Thank you so much @lgrignon
This seems to solve the problem. I was not able to get the actual project working, as there are other errors, but the small test project I made is compiling without any errors. I am sure this will fix my problem.

A question though, this option <javaCompilerExtraOptions>-source,1.8,-target,1.8</javaCompilerExtraOptions> Does it mean the java 11 is not supported for java candies? I am rather avoiding jdk15 code-blocks in my code in entirity (not just jsweet specific code) waiting for this to be implemented in jsweet before I get addicted to it, but here I see --source 1.8 so I was wondering what are the actual limitations. And yes please take your time to implement jdk11 features or jdk15 features I am in no hurry or need, I can manage with what is there.

Regarding integration into jsweet candies

If your candy is meant to be shared, I recommend that you integrate it into the following organization, if ok for you: https://github.com/jsweet-candies/

I have been actually avoiding this thinking it would involve some permission from JSweet and it might take long, it is quiet a pleasant surprising that on the contrary I am being invited. Although I have not marked the project as alpha in the maven pom, luvml might not be suitable for general public yet. I am changing it too often as of now. I think I will wait for the API to stabilize and it being used in enough projects successfully before advising general public to use it. Right now I have kept it open because it allows easy collaboration like how you created a PR.

With luvml I am able to get the work of a nice decent html DSL. My next wish list with JSweet and Luvml is to make it work "nicely" with ReactJS and another ultimate nice thing would be to provide something similar to JSX in the JVM. Then I want to be able to use it with things like Atlaskit-Editor which seems to be the most decent WYSIWYG editor with support for collaborative editing (for free) and which seems to work with Grammarly, such a combination is literally impossible in today's world in a pure desktop app. I wish there was some decent tooling with combination of things like JavaFX (with GraalVM) and JSweet that something written once, truly worked on all platforms (web,android,desktop,ios, etc.)

lgrignon commented 3 years ago

JSweet 3 is fully compatible with Java 11, but does not support latest Java syntax (> 11), hence this issue: https://github.com/cincheo/jsweet/issues/647 We recently discussed this and it seems like a few effort to get something nice done so we may do it pretty quickly.

luvml seems like a cool project as well as the next coming projects you are mentionning. I will keep following it with interest :) I understand that you want to stabilize your API before joining jsweet-candies organization. This is just an option :)

Have fun using JSweet & see you around