Skip to content

j2ts/java-to-typescript-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-to-typescript-maven-plugin

Create typescript definitions from annotated java (or other JVM language) types

AppVeyor branch Travis (.org) branch JDK Lines of Code Coverage Project Status: Active – The project has reached a stable, usable state and is being actively developed. Maven Central License

Usage

<project>
    <plugins>
        <plugin>
            <groupId>com.github.j2ts</groupId>
            <artifactId>java-to-typescript-maven-plugin</artifactId>
            <version>${j2ts.version}</version>
            <executions><execution><goals><goal>j2ts</goal></goals></execution></executions>
            <configuration>
                <annotation>com.example.AKotlinAnnotation</annotation>
                <!-- Optional -->
                <outputFileRef>${project.build.outputDirectory}/j2ts/${project.artifactId}.ts.d</outputFileRef>
            </configuration>
        </plugin>
    </plugins>
</project>

Nullable member properties

It seems that kotlin nullability doesn't load with the URLClassLoader KType#isMarkedNullable always returns false, and ts-generator needs that info to generate correctly

Local Nexus

Might prevent you from obtaining the com.github.ntrrgc:ts-generator dependency, that is provided by JitPack. In this case you might need to build using a separate settings.xml file (using maven -s flag), or by adding JitPack as a repository in your Nexus.

mvn clean install -s ./settings.xml -e

Dependencies