Thorsten Schöning created AXIS2-5873:
----------------------------------------
Summary: "Apache Axis2 - Distribution" doesn't build on Windows
Key: AXIS2-5873
URL: https://issues.apache.org/jira/browse/AXIS2-5873
Project: Axis2
Issue Type: Bug
Components: modules
Affects Versions: 1.8.0
Environment: Windows 10 Pro x86-64, JDK 1.8 x86-64
Reporter: Thorsten Schöning
Attachments: support Windows paths for distribution.patch
"distribution/pom.xml" contains embedded Groovy and uses Maven build properties
to access some paths, which resolve to some string using "\" on Windows. The
problem is that these strings contain only one "\", which is valid in XML, but
are forwarded to Groovy code, where those strings become invalid.
{CODE}
[INFO] --- gmavenplus-plugin:1.5:execute (check-webapp-content) @ distribution
---
[DEBUG] Configuring mojo org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute
from plugin realm
ClassRealm[plugin>org.codehaus.gmavenplus:gmavenplus-plugin:1.5, parent:
sun.misc.Launcher$AppClassLoader@5c647e05]
[DEBUG] Configuring mojo
'org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute' with
include-project-test-dependencies configurator -->
[DEBUG] (f) allowSystemExits = false
[DEBUG] (f) bindPropertiesToSeparateVariables = true
[DEBUG] (f) continueExecuting = false
[DEBUG] (f) mojoExecution =
org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute {execution:
check-webapp-content}
[DEBUG] (f) pluginArtifacts =
[org.codehaus.gmavenplus:gmavenplus-plugin:maven-plugin:1.5:,
org.codehaus.groovy:groovy-all:jar:2.4.4:runtime,
org.apache.maven:maven-plugin-api:jar:2.2.1:compile,
org.apache.maven:maven-project:jar:2.2.1:compile,
org.apache.maven:maven-settings:jar:2.2.1:compile,
org.apache.maven:maven-profile:jar:2.2.1:compile,
org.apache.maven:maven-model:jar:2.2.1:compile,
org.apache.maven:maven-artifact-manager:jar:2.2.1:compile,
backport-util-concurrent:backport-util-concurrent:jar:3.1:compile,
org.codehaus.plexus:plexus-interpolation:jar:1.11:compile,
org.codehaus.plexus:plexus-utils:jar:1.5.15:compile,
org.apache.maven:maven-artifact:jar:2.2.1:compile,
org.apache.maven:maven-core:jar:2.2.1:compile,
org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1:compile,
org.slf4j:slf4j-jdk14:jar:1.5.6:runtime, org.slf4j:slf4j-api:jar:1.5.6:runtime,
org.slf4j:jcl-over-slf4j:jar:1.5.6:runtime,
org.apache.maven.reporting:maven-reporting-api:jar:2.2.1:compile,
org.apache.maven.doxia:doxia-sink-api:jar:1.1:compile,
org.apache.maven.doxia:doxia-logging-api:jar:1.1:compile,
org.apache.maven:maven-repository-metadata:jar:2.2.1:compile,
org.apache.maven:maven-error-diagnostics:jar:2.2.1:compile,
commons-cli:commons-cli:jar:1.2:compile,
org.apache.maven:maven-plugin-descriptor:jar:2.2.1:compile,
org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile,
org.apache.maven:maven-monitor:jar:2.2.1:compile,
classworlds:classworlds:jar:1.1:compile,
org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile,
org.sonatype.plexus:plexus-cipher:jar:1.4:compile,
org.apache.maven.shared:file-management:jar:1.2.1:compile,
org.apache.maven.shared:maven-shared-io:jar:1.1:compile,
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6:compile,
org.codehaus.plexus:plexus-container-default:jar:1.6:compile,
org.apache.xbean:xbean-reflect:jar:3.7:compile,
com.google.collections:google-collections:jar:1.0:compile,
org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile,
org.apache.maven:maven-plugin-registry:jar:2.2.1:runtime,
org.fusesource.jansi:jansi:jar:1.11:runtime, jline:jline:jar:2.12.1:runtime,
org.apache.ant:ant:jar:1.9.4:runtime,
org.apache.ant:ant-launcher:jar:1.9.4:runtime,
org.apache.ivy:ivy:jar:2.4.0:runtime]
[DEBUG] (f) project = MavenProject:
org.apache.axis2:distribution:1.8.0-SNAPSHOT @
C:\Users\tschoening\Documents\Eclipse\Java
Axis2\axis2\modules\distribution\pom.xml
[DEBUG] (f) scripts = [import java.util.jar.*
def jar = new JarInputStream(new
FileInputStream("C:\Users\tschoening\.m2\repository\org\apache\axis2\axis2-webapp\1.8.0-SNAPSHOT\axis2-webapp-1.8.0-SNAPSHOT.war"))
def expected = new HashSet()
def entry
while(entry = jar.nextJarEntry) {
expected.add(entry.name)
}
jar.close()
jar = new JarInputStream(new
FileInputStream("C:\Users\tschoening\Documents\Eclipse\Java
Axis2\axis2\modules\distribution\target/axis2-1.8.0-SNAPSHOT/dist/axis2.war"))
while(entry = jar.nextJarEntry) {
if (!expected.remove(entry.name)) {
throw new Error("Unexpected entry
in Web app: " + entry.name)
}
}
if (!expected.empty) {
throw new Error("Missing entries in Web
app: " + expected)
}
jar.close()]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@3d904e9c
[DEBUG] (f) skipTests = false
[DEBUG] (f) sourceEncoding = UTF-8
[DEBUG] -- end configuration --
[INFO] Using Groovy 2.4.4 to perform execute.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Axis2 - Distribution ........................ FAILURE [ 49.237 s]
[INFO] Samples parent POM ................................. SKIPPED
[INFO] JAXWS - Starting from Java Example ................. SKIPPED
[INFO] JAXWS Addressbook Service .......................... SKIPPED
[INFO] JAXWS Calculator Service ........................... SKIPPED
[INFO] JAXWS Interop Sample ............................... SKIPPED
[INFO] JAXWS Samples - Echo, Ping, MTOM ................... SKIPPED
[INFO] Apache Axis2 -JAXWS Version Service ................ SKIPPED
[INFO] Apache Axis2 Transport-HTTPS sample ................ SKIPPED
[INFO] httpsService ....................................... SKIPPED
[INFO] httpsClient ........................................ SKIPPED
[INFO] Apache Axis2 Transport-JMS sample .................. SKIPPED
[INFO] jmsService ......................................... SKIPPED
[INFO] databinding-tests .................................. SKIPPED
[INFO] jaxbri-tests ....................................... SKIPPED
[INFO] echo ............................................... SKIPPED
[INFO] webapp-tests ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.245 s
[INFO] Finished at: 2017-08-28T19:27:47+02:00
[INFO] Final Memory: 60M/459M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute (check-webapp-content) on
project distribution: Error occurred while calling a method on a Groovy class
from classpath. InvocationTargetException: startup failed:
[ERROR] Script1.groovy: 3: unexpected char: '\' @ line 3, column 89.
[ERROR] Stream(new FileInputStream("C:\Users\tsc
[ERROR] ^
[ERROR]
[ERROR] 1 error
[ERROR] -> [Help 1]
{CODE}
The attached patch fixes the problem by using "%url%" instead of "%file%",
because that can be converted to a path at runtime easily. Please note that
while the value is named "%url%", I'm not creating an instance of the "URL"
class in Java to parse that string, but using "URI" instead directly, because
that's what's needed by the "File" CTOR anyway in the end. You might consider
that unclean, I think the difference is academic and it works as is for me. So
feel free to change it as necessary.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]