Casto
Casto

Reputation: 305

Gwt compiling error: unable to find entry point when it's not in src/main/java

I have an error compiling my app:

[INFO] Compiling module com.mycompany.myapp.MyAppMocked
[INFO]    Finding entry point classes
[INFO]       [ERROR] Unable to find type 'com.mycompany.myapp.client.mock.MockEntryPoint'
[INFO]          [ERROR] Hint: Check that the type name 'com.mycompany.myapp.client.mock.MockEntryPoint' is really what you meant
[INFO]          [ERROR] Hint: Check that your classpath includes all required source roots

In my .gwt.xml, I have:

<entry-point class="com.mycompany.myapp.client.mock.MockEntryPoint" />

The problem occurs when I put MockEntryPoint.java in src/mocked/java instead of src/main/java.

I need to have both directories to exclude everything in src/mocked/java when compiling the "no-mock" version.

If I move MockEntryPoint.java to src/main/java, the compilation will succeed with no error. In both cases, the class MockEntryPoint is in the package "com.mycompany.myapp.client.mock".

How can I tell gwt to look for my entry class in src/mocked/java?

Upvotes: 2

Views: 3552

Answers (2)

Swapnil
Swapnil

Reputation: 13

Replace statement <source path='main'/> with <source path='mocked'/> in your .gwt.xml Then compiler will know which directory to choose for compilation.

I hope it helps.

Upvotes: 0

Thomas Broyer
Thomas Broyer

Reputation: 64541

Assuming this is a Maven project, you need to add src/mocked/java as a source folder. In Maven, it has to be done using the build-helper-maven-plugin's add-source mojo.


But there's little to no reason to have that src/mocked hierarchy:

  • you can put everything in src/main and just compile the GWT module you need/want (set the module or modules configuration property for the gwt-maven-plugin accordingly)
  • if you want them clearly separated, Maven wants you to use distinct Maven modules/projects. You don't want to fight against Maven.

Upvotes: 2

Related Questions