[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Build error on JDK 7 for mvn with jgit packaging pom

Hi there,

Just a note to people using JDK 7 as default.

When building jgit using the following command line:

  mvn -f org.eclipse.jgit.packaging/pom.xml clean install

The following error may occur:

Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:714)
	at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:451)
	at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:376)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:182)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
	at java.util.Arrays.sort(Arrays.java:472)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorSelector.hasValidMirror(MirrorSelector.java:317)
        ...

(Full stacktrace at end of mail.)

The problem is a bug in Equinox, here's the bug report:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=317785

It's fixed, but jgit probably uses an older version of it via Tycho.

A work-around is to use JDK 6 for building or invoke mvn with the following
system property set:

  _JAVA_OPTIONS=-Djava.util.Arrays.useLegacyMergeSort=true mvn ...

Should a note about this be added to the contributor guide?

Regards,
  Robin Stocker


Here's the full stack trace:


[ERROR] Internal error: java.lang.IllegalArgumentException: Comparison method violates its general contract! -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:170)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:714)
	at java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:451)
	at java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:376)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:182)
	at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
	at java.util.Arrays.sort(Arrays.java:472)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorSelector.hasValidMirror(MirrorSelector.java:317)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:517)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:576)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.getArtifact(MirrorRequest.java:248)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transferSingle(MirrorRequest.java:223)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transfer(MirrorRequest.java:179)
	at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.perform(MirrorRequest.java:115)
	at org.eclipse.tycho.p2.maven.repository.MavenMirrorRequest.perform(MavenMirrorRequest.java:71)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:565)
	at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifacts(SimpleArtifactRepository.java:616)
	at org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository.getArtifacts(CompositeArtifactRepository.java:305)
	at org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository.getArtifacts(CompositeArtifactRepository.java:305)
	at org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository.getArtifacts(CompositeArtifactRepository.java:305)
	at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveProject(P2ResolverImpl.java:338)
	at org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveProject(P2ResolverImpl.java:293)
	at org.eclipse.tycho.p2.facade.P2TargetPlatformResolver.doResolvePlatform(P2TargetPlatformResolver.java:389)
	at org.eclipse.tycho.p2.facade.P2TargetPlatformResolver.resolvePlatform(P2TargetPlatformResolver.java:150)
	at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:90)
	at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:91)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:275)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:158)
	... 11 more
[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/InternalErrorException