[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] sandbox
[INFO] sandbox-shared
[INFO] vit-gin-client
[INFO] sandbox-client
[INFO] sandbox-server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sandbox 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sandbox-shared 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ sandbox-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\sandbox-shared\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sandbox-shared ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ sandbox-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\sandbox-shared\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sandbox-shared ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ sandbox-shared ---
[INFO] No tests to run.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building vit-gin-client 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:enforce-encoding (default-enforce-encoding) @ vit-gin-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:add-super-sources (default-add-super-sources) @ vit-gin-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:add-test-super-sources (default-add-test-super-sources) @ vit-gin-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-sources (default-import-sources) @ vit-gin-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:generate-module (default-generate-module) @ vit-gin-client ---
[INFO] E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\target\classes\com\mycompany\gin\VitGin.gwt.xml up to date - skipping
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:generate-module-metadata (default-generate-module-metadata) @ vit-gin-client ---
[INFO] E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\target\classes\META-INF\gwt\mainModule up to date - skipping.
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ vit-gin-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\src\main\resources
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\src\main\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ vit-gin-client ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-test-sources (default-import-test-sources) @ vit-gin-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\src\test\java
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ vit-gin-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\src\test\resources
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\vit-gin-client\src\test\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ vit-gin-client ---
[INFO] No sources to compile
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:test (default-test) @ vit-gin-client ---
[INFO] No tests to run.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sandbox-client 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:enforce-encoding (default-enforce-encoding) @ sandbox-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:add-super-sources (default-add-super-sources) @ sandbox-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:add-test-super-sources (default-add-test-super-sources) @ sandbox-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:generate-module (default-generate-module) @ sandbox-client ---
[INFO] E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\target\classes\com\mycompany\App.gwt.xml up to date - skipping
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ sandbox-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\src\main\resources
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\src\main\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ sandbox-client ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-sources (default-import-sources) @ sandbox-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ sandbox-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\src\test\resources
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\src\test\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ sandbox-client ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-test-sources (default-import-test-sources) @ sandbox-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:test (default-test) @ sandbox-client ---
[INFO] GWT tests report directory: E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.mycompany.AppSuite
Starting Jetty on port 0
[WARN] ServletContainerInitializers: detected. Class hierarchy: empty
[WARN] Failed to load servlet class 'com.mycompany.GreetingServiceImpl' declared in 'com.mycompany.AppJUnit.JUnit'
java.lang.ClassNotFoundException: com.mycompany.GreetingServiceImpl
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at org.eclipse.jetty.webapp.WebAppClassLoader.findClass(WebAppClassLoader.java:510)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:441)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:403)
at org.eclipse.jetty.server.handler.ContextHandler.loadClass(ContextHandler.java:1583)
at com.google.gwt.junit.JUnitShell.maybeCompileForWebMode(JUnitShell.java:1119)
at com.google.gwt.junit.CompileStrategy.maybeCompileModuleImpl2(CompileStrategy.java:183)
at com.google.gwt.junit.CompileStrategy.maybeCompileModuleImpl(CompileStrategy.java:113)
at com.google.gwt.junit.SimpleCompileStrategy.maybeCompileModule(SimpleCompileStrategy.java:36)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1313)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1281)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:670)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Compiling module com.mycompany.AppJUnit.JUnit
Ignored 3 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Compiling 1 permutation
Compiling permutation 0...
Compile of permutations succeeded
Compilation succeeded -- 6,418s
Linking into E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\target\gwt-tests\www\com.mycompany.AppJUnit.JUnit
Link succeeded
Linking succeeded -- 0,313s
Ignored 3 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Tracing compile failure path for type 'com.mycompany.client.AppTest'
[ERROR] Errors in 'file:/E:/Users/vitrums/workspace-neon/sandbox/sandbox-client/target/test-classes/com/mycompany/client/AppTest.java'
[ERROR] Line 28: No source code is available for type com.mycompany.shared.FieldVerifier; did you forget to inherit a required module?
[ERROR] Line 42: No source code is available for type com.mycompany.shared.GreetingServiceAsync; did you forget to inherit a required module?
[ERROR] Line 52: No source code is available for type com.mycompany.shared.GreetingResponse; did you forget to inherit a required module?
[ERROR] Line 42: No source code is available for type com.mycompany.shared.GreetingService; did you forget to inherit a required module?
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
Tracing compile failure path for type 'com.mycompany.client.AppTest'
[ERROR] Errors in 'file:/E:/Users/vitrums/workspace-neon/sandbox/sandbox-client/target/test-classes/com/mycompany/client/AppTest.java'
[ERROR] Line 28: No source code is available for type com.mycompany.shared.FieldVerifier; did you forget to inherit a required module?
[ERROR] Line 42: No source code is available for type com.mycompany.shared.GreetingServiceAsync; did you forget to inherit a required module?
[ERROR] Line 52: No source code is available for type com.mycompany.shared.GreetingResponse; did you forget to inherit a required module?
[ERROR] Line 42: No source code is available for type com.mycompany.shared.GreetingService; did you forget to inherit a required module?
[ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 9.727 sec <<< FAILURE! - in com.mycompany.AppSuite
testGreetingService(com.mycompany.client.AppTest) Time elapsed: 9.679 sec <<< ERROR!
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.mycompany.client.AppTest' had compile errors; check log for details
at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:732)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1325)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1281)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:670)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
testFieldVerifier(com.mycompany.client.AppTest) Time elapsed: 0.002 sec <<< ERROR!
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.mycompany.client.AppTest' had compile errors; check log for details
at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:732)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1325)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1281)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:670)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Results :
Tests in error:
AppTest>GWTTestCase.run:247->GWTTestCase.runTest:421 » JUnitFatalLaunch The te...
AppTest>GWTTestCase.run:247->GWTTestCase.runTest:421 » JUnitFatalLaunch The te...
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] sandbox ............................................ SUCCESS [ 0.005 s]
[INFO] sandbox-shared ..................................... SUCCESS [ 0.978 s]
[INFO] vit-gin-client ..................................... SUCCESS [ 1.521 s]
[INFO] sandbox-client ..................................... FAILURE [ 10.712 s]
[INFO] sandbox-server ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.742 s
[INFO] Finished at: 2016-12-01T21:54:22+03:00
[INFO] Final Memory: 13M/125M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-6:test (default-test) on project sandbox-client: There are test failures.
[ERROR]
[ERROR] Please refer to E:\Users\vitrums\workspace-neon\sandbox\sandbox-client\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :sandbox-client
package com.mycompany;
import com.google.gwt.junit.tools.GWTTestSuite;
import com.mycompany.client.AppTest;
import junit.framework.Test;
import junit.framework.TestSuite;
public class AppSuite extends GWTTestSuite {
public static Test suite() {
TestSuite suite = new TestSuite("Tests for App");
suite.addTestSuite(AppTest.class);
return suite;
}
}
package com.mycompany.client;
import com.mycompany.shared.FieldVerifier;
import com.mycompany.shared.GreetingResponse;
import com.mycompany.shared.GreetingService;
import com.mycompany.shared.GreetingServiceAsync;
import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
/**
* GWT JUnit tests must extend GWTTestCase.
*/
public class AppTest extends GWTTestCase {
/**
* Must refer to a valid module that sources this class.
*/
public String getModuleName() {
return "com.mycompany.AppJUnit";
}
/**
* Tests the FieldVerifier.
*/
public void testFieldVerifier() {
assertFalse(FieldVerifier.isValidName(null));
assertFalse(FieldVerifier.isValidName(""));
assertFalse(FieldVerifier.isValidName("a"));
assertFalse(FieldVerifier.isValidName("ab"));
assertFalse(FieldVerifier.isValidName("abc"));
assertTrue(FieldVerifier.isValidName("abcd"));
}
/**
* This test will send a request to the server using the greetServer method in
* GreetingService and verify the response.
*/
public void testGreetingService() {
// Create the service that we will test.
GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
ServiceDefTarget target = (ServiceDefTarget) greetingService;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "app/greet");
// Since RPC calls are asynchronous, we will need to wait for a response
// after this test method returns. This line tells the test runner to wait
// up to 10 seconds before timing out.
delayTestFinish(10000);
// Send a request to the server.
greetingService.greetServer("GWT User", new AsyncCallback<GreetingResponse>() {
public void onFailure(Throwable caught) {
// The request resulted in an unexpected error.
fail("Request failure: " + caught.getMessage());
}
public void onSuccess(GreetingResponse result) {
// Verify that the response is correct.
assertTrue(result.getGreeting().startsWith("Hello, GWT User!"));
// Now that we have received a response, we need to tell the test runner
// that the test is complete. You must call finishTest() after an
// asynchronous test finishes successfully, or the test will time out.
finishTest();
}
});
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
When updating your version of GWT, you should also update this DTD reference,
so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.0//EN"
"http://gwtproject.org/doctype/2.8.0/gwt-module.dtd">
<module>
<!-- Inherit our applications main module. -->
<inherits name='com.mycompany.App'/>
<!-- Specify the path to any remote services. -->
<servlet path="/app/greet" class="com.mycompany.GreetingServiceImpl" />
</module>
It's also not clear for me why greetingService test classes must've been completely excluded from the modular-webapp archetype.
Archetypes in general serve to unify the maximum of core best practices relevant to some particular project structure (tests including), don't they?
Even though I can read .pom configuration files, I'm not strong in configuring them myself, when it comes to multi-module project. Especially when it comes to packaging servlets as jar.
So I introduced the new module sandbox-server-lib. But which files should it consume from sandbox-server? E.g. if I move only com.mycompany.GreetingServiceImpl.java under sandbox-server-lib I won't have servlet mappings, necessary for jetty to operate during tests in sandbox-client (should I duplicate some files and have them in both modules)?
If I move /src/main/webapp, then I'm not even sure what will be left for sandbox-server to package as war and how to deploy it in container. And which dependencies, plugins and configurations would sandbox-server-lib's pom require (and what left from sandbox-server after all these operations)?
I know I'm terribly lost :)
Yes, you look like you're lost :-)I'm afraid you can't develop in any given technology without learning the "basics" (between quotes, because it can mean a lot of things; learning curves are steep these days, and tending to become each year steeper than the preceding) : what is the classpath, a classloader, a JAR, a WAR, how to build a (simple) JAR (using the command-line, or some build tool), how to build a (simple) WAR. GWT adds a lot of things to those "basics", particularly when your build tool is as opinionated (and broken-by-design) as Maven.I'm a bottom-up learner, first learning how things work (from documentation, not experimentation) before doing something with them, rather than a top-down learner, first doing things (possibly copy/pasting snippets here and there "until it works") then trying to understand how and why it all worked. That makes me a terrible teacher for top-down learners, who are better served with heavy full-stack frameworks and full scaffolding (ultimately leading to a huge amount of third-party code to do a simple hello world, if you ask me). Please note that I'm not judging "top-down learners", everybody is different and learns differently; I'm only acknowledging I'm generally unable to help them. I'm not sure what kind of learner you are, just letting you know that if you're a top-down one, then I'm probably not the right "teacher", and my gwt-maven-archetypes haven't been tailored for you (I am expecting average knowledge of Maven and GWT).
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.example.project.AppSuite
Starting Jetty on port 0
[WARN] ServletContainerInitializers: detected. Class hierarchy: empty
Compiling module com.example.project.AppJUnit.JUnit
Ignored 3 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Compiling 1 permutation
Compiling permutation 0...
Compile
of permutations succeeded
Compilation succeeded -- 6,136s
Linking into E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\gwt-tests\www\com.example.project.AppJUnit.JUnit
Link succeeded
Linking succeeded -- 0,273s
Ignored 3 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Tracing compile failure path for type 'com.example.project.AppGwtTest'
[ERROR] Errors in 'file:/E:/Users/vitrums/workspace-neon/myartifact/myartifact-client/target/test-classes/com/example/project/AppGwtTest.java'
[ERROR] Line 24: No source code is available for type com.example.project.FieldVerifier; did you forget to inherit a required module?
[ERROR] Line 48: No source code is available for type com.example.project.GreetingResponse; did you forget to inherit a required module?
[ERROR] Line 38: No source code is available for type com.example.project.GreetingServiceAsync; did you forget to inherit a required module?
[ERROR] Line 38: No source code is available for type com.example.project.GreetingService; did you forget to inherit a required module?
[ERROR] Hint: Your source appears not to live underneath a subpackage called 'client'; no problem, but you'll need to use the <source> directive in your module to make it accessible
Tracing compile failure path for type 'com.example.project.AppGwtTest'
[ERROR] Errors in 'file:/E:/Users/vitrums/workspace-neon/myartifact/myartifact-client/target/test-classes/com/example/project/AppGwtTest.java'
[ERROR] Line 24: No source code is available for type com.example.project.FieldVerifier; did you forget to inherit a required module?
[ERROR] Line 48: No source code is available for type com.example.project.GreetingResponse; did you forget to inherit a required module?
[ERROR] Line 38: No source code is available for type com.example.project.GreetingServiceAsync; did you forget to inherit a required module?
[ERROR] Line 38: No source code is available for type com.example.project.GreetingService; did you forget to inherit a required module?
[ERROR] Hint: Your source appears not to live underneath a subpackage called 'client'; no problem, but you'll need to use the <source> directive in your module to make it accessible
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 8.946 sec <<< FAILURE! - in com.example.project.AppSuite
testGreetingService(com.example.project.AppGwtTest) Time elapsed: 8.879 sec <<< ERROR!
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.example.project.AppGwtTest' had compile errors; check log for details
at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:732)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1325)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1281)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:670)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
testFieldVerifier(com.example.project.AppGwtTest) Time elapsed: 0.002 sec <<< ERROR!
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.example.project.AppGwtTest' had compile errors; check log for details
at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:732)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1325)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1281)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:670)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Results :
Tests in error:
AppGwtTest>GWTTestCase.run:247->GWTTestCase.runTest:421 » JUnitFatalLaunch The...
AppGwtTest>GWTTestCase.run:247->GWTTestCase.runTest:421 » JUnitFatalLaunch The...
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myartifact ......................................... SUCCESS [ 0.003 s]
[INFO] myartifact-shared .................................. SUCCESS [ 0.490 s]
[INFO] myartifact-server-lib .............................. SUCCESS [ 0.039 s]
[INFO] myartifact-client .................................. FAILURE [ 10.314 s]
[INFO] myartifact-server .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.031 s
[INFO] Finished at: 2016-12-02T20:37:32+03:00
[INFO] Final Memory: 17M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-6:test (default-test) on project myartifact-client: There are test failures.
[ERROR]
[ERROR] Please refer to E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :myartifact-client
<?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>
<parent>
<groupId>com.example.project</groupId>
<artifactId>myartifact</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>myartifact-client</artifactId>
<packaging>gwt-app</packaging>
<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>myartifact-shared</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>myartifact-shared</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>myartifact-server-lib</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<moduleName>com.example.project.App</moduleName>
<moduleShortName>app</moduleShortName>
</configuration>
</plugin>
<!-- Skip normal test execution, we use gwt:test instead -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
You might have just uncovered a bug in gwt:test. I think a workaround would be to move the maven-source-plugin to the process-classes phase.
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>process-classes</phase> <!-- fix -->
<!-- <phase>package</phase> -->
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] myartifact
[INFO] myartifact-shared
[INFO] myartifact-server-lib
[INFO] myartifact-client
[INFO] myartifact-server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myartifact 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myartifact-shared 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myartifact-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-shared\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myartifact-shared ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to E:\Users\vitrums\workspace-neon\myartifact\myartifact-shared\target\classes
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar-no-fork (attach-sources) @ myartifact-shared ---
[INFO] Building jar: E:\Users\vitrums\workspace-neon\myartifact\myartifact-shared\target\myartifact-shared-0.0.1-SNAPSHOT-sources.jar
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myartifact-shared ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-shared\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myartifact-shared ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ myartifact-shared ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myartifact-server-lib 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myartifact-server-lib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myartifact-server-lib ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to E:\Users\vitrums\workspace-neon\myartifact\myartifact-server-lib\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myartifact-server-lib ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myartifact-server-lib ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ myartifact-server-lib ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myartifact-client 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:enforce-encoding (default-enforce-encoding) @ myartifact-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:add-super-sources (default-add-super-sources) @ myartifact-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:add-test-super-sources (default-add-test-super-sources) @ myartifact-client ---
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:generate-module (default-generate-module) @ myartifact-client ---
[INFO] E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\classes\com\example\project\App.gwt.xml up to date - skipping
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ myartifact-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\src\main\resources
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\src\main\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myartifact-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\classes
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-sources (default-import-sources) @ myartifact-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ myartifact-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\src\test\resources
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\src\test\super
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myartifact-client ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\test-classes
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:import-test-sources (default-import-test-sources) @ myartifact-client ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- gwt-maven-plugin:1.0-rc-6:test (default-test) @ myartifact-client ---
[INFO] GWT tests report directory: E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.example.project.AppSuite
Starting Jetty on port 0
[WARN] ServletContainerInitializers: detected. Class hierarchy: empty
Compiling module com.example.project.AppJUnit.JUnit
Ignored 1 unit with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Compiling 1 permutation
Compiling permutation 0...
Compile
of permutations succeeded
Compilation succeeded -- 21,181s
Linking into E:\Users\vitrums\workspace-neon\myartifact\myartifact-client\target\gwt-tests\www\com.example.project.AppJUnit.JUnit
Link
succeeded
Linking succeeded -- 0,355s
Ignored 1 unit with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Starting http://localhost:50070/com.example.project.AppJUnit.JUnit/junit.html on browser FF38
200 - GET /com.example.project.AppJUnit.JUnit/junit.html (127.0.0.1)
200 - GET /com.example.project.AppJUnit.JUnit/com.example.project.AppJUnit.JUnit.nocache.js (127.0.0.1)
200 - GET /com.example.project.AppJUnit.JUnit/83FA091D70963A1A3E4C52B7399675F9.cache.js (127.0.0.1)
200 - GET /com.example.project.AppJUnit.JUnit/gwt/clean/clean.css (127.0.0.1)
200 - POST /com.example.project.AppJUnit.JUnit/junithost (127.0.0.1) 216 bytes
200 - POST /com.example.project.AppJUnit.JUnit/app/greet (127.0.0.1) 178 bytes
200 - POST /com.example.project.AppJUnit.JUnit/junithost (127.0.0.1) 188 bytes
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 26.749 sec - in com.example.project.AppSuite
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myartifact-server 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ myartifact-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-server\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ myartifact-server ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to E:\Users\vitrums\workspace-neon\myartifact\myartifact-server\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ myartifact-server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\Users\vitrums\workspace-neon\myartifact\myartifact-server\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ myartifact-server ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ myartifact-server ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myartifact ......................................... SUCCESS [ 0.004 s]
[INFO] myartifact-shared .................................. SUCCESS [ 2.136 s]
[INFO] myartifact-server-lib .............................. SUCCESS [ 0.127 s]
[INFO] myartifact-client .................................. SUCCESS [ 28.844 s]
[INFO] myartifact-server .................................. SUCCESS [ 0.128 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.418 s
[INFO] Finished at: 2016-12-02T22:00:11+03:00
[INFO] Final Memory: 31M/207M
[INFO] ------------------------------------------------------------------------
Is it safe to leave it like this?
Because, actually, using <servlet> in GWTTestCases is not seen as a good practice (anymore). GWTTestCases should be unit tests, running in a GWT/browser environment, not integration tests. For that, the preferred way is to use end-to-end tests.