<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
package com.example;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
@JsType(isNative = true)
public class MyJsLibrary {
public native void myMethod();
}
script
<script src="com/example/MyJsLibrary.js"></script>
<script>
var myLibrary = new com.example.MyJsLibrary();
myLibrary.myMethod();
</script>