Maven.skip.test skips the test compile and run, skipTests property only tells surefire to not run and judge the unit tests
--
http://bernd.eckenfels.net

Von: undertow-dev-bounces@lists.jboss.org <undertow-dev-bounces@lists.jboss.org> im Auftrag von Brad Wood <bdw429s@gmail.com>
Gesendet: Tuesday, June 16, 2020 9:21:55 PM
An: Undertow Developers <undertow-dev@lists.jboss.org>
Betreff: [undertow-dev] Building Undertow
 
I'm trying to build Undertow using the (sparse) instructions here and having a heck of a time.  

https://undertow.io/undertow-docs/undertow-docs-2.1.0/index.html  

cd undertow && mvn install  

So firstly, I'm not super familiar with Maven (not a full time java dev) but when I skip the tests, the build fails.  Here is the note in the docs, which is confusing for a couple reasons:

If you attempt to build with -Dmaven.test.skip=true for your initial build the build will fail, as the core test jar will not be built and the Servlet module has a test scoped dependency on this jar. Either use -DskipTests, or just let the tests run the first time.  
  • First it says the build will fail if the tests are skipped, but then seems to imply that I can work around this by setting some system properties.  
  • What is the difference between the maven.test.skip property and the skiptests property?  Do I need both of them?  
If I try to run the build like so (Using Maven 3.6.3 and java 11) using a fresh clone of the Undertow repo with the "master" branch checked out:

mvn install -Dmaven.test.skip=true -DskipTests

I get this build failure still:

[ERROR] Failed to execute goal on project undertow-servlet: Could not resolve dependencies for project io.undertow:undertow-servlet:jar:2.1.4.Final-SN
APSHOT: Could not find artifact io.undertow:undertow-core:jar:tests:2.1.4.Final-SNAPSHOT -> [Help 1]

So, I'm not sure what to do there.  The docs state that setting those JVM args is an alternative to running the tests but it doesn't work.

Now, the first thing I tried was actually just to let the tests run, but this proved to be even more troublesome than skipping the tests!  I get tons of test failures and other errors and the behavior differs whether I'm using Java 8 or Java 11 (fun!) and the tests usually just hang and won't complete.  

When I run the build (with tests) on Java 1.8.0_161 they hang on this test and never finish.

[INFO] Running io.undertow.server.handlers.ReceiverTestCase

When I run the build (with tests) on Java 11.0.6, I get the following errors:

[ERROR] testSpnegoSuccess(io.undertow.server.security.SpnegoDigestAuthenticationTestCase)  Time elapsed: 0.01 s  <<< FAILURE!
java.lang.AssertionError: Expected header not found.

[ERROR] testSpnegoSuccess(io.undertow.server.security.SpnegoBasicAuthenticationTestCase)  Time elapsed: 0 s  <<< FAILURE!
java.lang.AssertionError: Expected header not found.

[ERROR] testSpnegoSuccess(io.undertow.server.security.SpnegoAuthenticationTestCase)  Time elapsed: 0 s  <<< FAILURE!
java.lang.AssertionError: expected:<401> but was:<403>

[ERROR] testNonDefaultFileSystem(io.undertow.server.handlers.file.PathResourceManagerTestCase)  Time elapsed: 0.042 s  <<< FAILURE!
java.lang.AssertionError: expected:</dir/resource.txt> but was:</dir/./resource.txt>

[ERROR] testRegexPattern(io.undertow.server.handlers.SameSiteCookieHandlerTestCase)  Time elapsed: 0.027 s  <<< ERROR!
javax.net.ssl.SSLException: Connection reset
 
And then it hangs on the same test case that Java 8 hangs on (io.undertow.server.handlers.ReceiverTestCase)

What does it take to get a local build of Undertow working?  If it matters, I'm trying to build on a Windows 7 machine.

Thanks!

~Brad

Developer Advocate
Ortus Solutions, Corp 

ColdBox Platform: http://www.coldbox.org