Failing to run 'mvn clean package' for the Java plugin

1,180 views
Skip to first unread message

Bernd G.

unread,
Jan 9, 2017, 10:22:58 AM1/9/17
to SonarQube
I ran into two problems when I tried to build the Java plugin locally. Trying to run 'mvn clean package' first got me this one:

Exception in thread "main" java.lang.AssertionError: org.xml.sax.SAXParseException: Failed to read external schema document "jar:file:/C:/Users/srzgob/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.1
1.jar!/com/sun/tools/xjc/reader/xmlschema/bindinfo/xjc.xsd", because "jar" access is not allowed.
...
Caused by: org.xml.sax.SAXParseException: Failed to read external schema document "jar:file:/C:/Users/srzgob/.m2/repository/org/glassfish/jaxb/jaxb-xjc/2.2.11/jaxb-xjc-2.2.11.jar!/com/sun/tools/xjc/reader/xmlschema/
bindinfo/xjc.xsd", because "jar" access is not allowed.

Full log output is in the attached file *-1.log

I looked around and found these:

I fixed my issue by adding the properties-maven-plugin to the Maven pom file. i propose to add this, or to switch the jaxb maven plugin.



The second issue is connected to my development setup - I'm behind an Enterprise firewall and all Maven dependencies are managed through Artifactory. When I tried to build the plugin on my Mac at home, everything went just fine. But I think that there is somewhere the root cause that triggers this issue, and then poor guys like me can also build it at work ;-). I found this, maybe that helps to identify the rough direction: http://stackoverflow.com/questions/13034611/dummydummyjar1-0-surefire-junit4-maven-and-nexus. The full output of the failing build run is in file *-2.log. I will now try to install the dependency manually and go from there.


java-plugin-mvn-clean-package-1.log
java-plugin-mvn-clean-package-2.log

Nicolas Peru

unread,
Jan 11, 2017, 5:34:19 AM1/11/17
to Bernd G., SonarQube
Hi, 

Thanks for letting us now your pains on building the plugin. 

For the first issue : which version of the JDK are you using ? this seems that this is related to a JDK bug that has been fixed so we may want to have a clear view on the issue before going to a solution as we (obviously) are not encountering the problem. 

Second issue : looking at your log I read : 

Exception: Unable to get dependency information for org.apache.maven.surefire:surefire-junit4:jar:2.18: Failed to retrieve POM for org.apache.maven.surefire:surefire-junit4:jar:2.18: Could not transfer artifact org.
apache.maven.surefire:surefire-junit4:pom:2.18 from/to internal-plugin (https://artifact.swissre.com/internal): Failed to transfer file: https://artifact.swissre.com/internal/org/apache/maven/surefire/surefire-junit
4/2.18/surefire-junit4-2.18.pom. Return code is: 503 , ReasonPhrase:Service Unavailable.

So I tend to think this is rather a problem with your proxy repository rather than anything else. 

Cheers, 

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/725ea160-9aa0-491b-a82a-96b547ceb9cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com

Bernd Götz

unread,
Jan 11, 2017, 5:17:53 PM1/11/17
to Nicolas Peru, SonarQube
Hi Nicolas,

I'm using:
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

Switching the maven plugin fixes the issue very simply and elegantly, imho. Just a suggestion.

On the second topic: Yes, indeed, I'm behind a proxy, and all dependencies are resolved via our Artifactory layer. That works generally very well, no issues with that normally. But here I have one. If I'm the only one with that problem, so be it. But I think it's connected to some deeper laying issue with the dependencies. Unfortunately that surfaces only within a setup like I have. I will investigate a bit further to see if I can do anything about it.

Best regards,
Bernd

Nicolas Peru

unread,
Jan 12, 2017, 2:25:50 AM1/12/17
to Bernd Götz, SonarQube
Hi, 

1 - The thing with switching the maven plugin is that it fixes the symptom, not the problem. So before choosing a solution I really want to be sure I understand the issue. I'll investigate it a bit further and try to reproduce. I guess you are running on windows : 64 bits ?

2 - For the dependency issue : given that the artifact it refers to is : https://repo1.maven.org/maven2/org/apache/maven/surefire/surefire-junit4/2.18/ and perfectly accessible I tend to think this is an issue on your mirror of central. So for me, not an issue on SonarJava build (confirmed by the fact that you can build correctly on your machine at home) (but I can be proven wrong). 

Cheers, 




For more options, visit https://groups.google.com/d/optout.

Bernd Götz

unread,
Jan 12, 2017, 4:01:21 PM1/12/17
to Nicolas Peru, SonarQube
1 - Yes, it's Windows 7 64-bit.
2 - Based on all I've read about the jaxb2 maven plugins, I doubt that it has to do with the proxy setup. The link in my initial message points out some class name issues with the plugin that you use. And based on what I read in http://stackoverflow.com/questions/2432859/difference-of-maven-jaxb-plugins it seems that switching to another plugin makes sense, at least to me. And helps me getting the thing to work in my context.
Best regards,
Reply all
Reply to author
Forward
0 new messages