title: Failed to export Java class to JavaScript via JsInterop in GWT
body: <p>I'm following the GWT documentation <a href="http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJsInterop.html" rel="nofollow noreferrer">Coding Basics - JavaScript: JsInterop</a> to export a Java class to JavaScript via annotation <code>@JsMethod</code>. However, the Java class is not transpiled into JavaScript.</p>
  
  <p>Here's my Java class:</p>
  
  <pre><code>package io.mincongh.client;
  
  import jsinterop.annotations.JsMethod;
  
  public class ExportedMethods {
  
    @JsMethod
    public static String sayHello(String name) {
      return "Hello, " + name;
    }
  }
  </code></pre>
  
  <p>And my project is built in Maven, via GWT Maven plugin 2.8.2:</p>
  
  <pre><code>&lt;plugin&gt;
    &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
    &lt;artifactId&gt;gwt-maven-plugin&lt;/artifactId&gt;
    &lt;executions&gt;
      &lt;execution&gt;
        &lt;goals&gt;
          &lt;goal&gt;compile&lt;/goal&gt;
          &lt;goal&gt;test&lt;/goal&gt;
          &lt;goal&gt;generateAsync&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
    &lt;/executions&gt;
    &lt;configuration&gt;
      &lt;runTarget&gt;StockMarket.html&lt;/runTarget&gt;
      &lt;modules&gt;
        &lt;module&gt;io.mincongh.StockMarket&lt;/module&gt;
      &lt;/modules&gt;
    &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>When I call the exported method in my browser's console. Then the method is not defined:</p>
  
  <blockquote>
  <pre><code>io.mincongh.client.ExportedMethods.sayHello('world');
  </code></pre>
    
    <p>VM59:1 Uncaught ReferenceError: io is not defined
       at :1:1</p>
  </blockquote>