dummy:dummy:jar:1.0, surefire-junit4, maven and Nexus
Asked Answered
W

5

11

So we recently implemented a Nexus server for our maven repository manager. We proxy about 30 outside repositories and funnel them all into a single group, which we point to in the settings.xml in mirrors with a *.

Before that, we didn't have this problem... and now we do. It frustrates me that there is little information on this dummy jar, where it comes from, or where I can get it to stop these failures. I have been researching for a few days and come up short with nothing. I am hoping the community might be able to help.

18-Oct-2012 22:50:31 [ERROR] BUILD ERROR 
18-Oct-2012 22:50:31 [INFO] ------------------------------------------------------------------------ 
18-Oct-2012 22:50:31 [INFO] Unable to generate classpath: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'org.apache.maven.surefire:surefire-junit4:jar': Cannot find parent: org.apache.maven.surefire:surefire-providers for project: null:surefire-junit4:jar:null for project null:surefire-junit4:jar:null 
18-Oct-2012 22:50:31 org.apache.maven.surefire:surefire-junit4:jar:2.12 
18-Oct-2012 22:50:31 
18-Oct-2012 22:50:31 from the specified remote repositories: 
18-Oct-2012 22:50:31 central (http://repo1.maven.org/maven2), 
18-Oct-2012 22:50:31 JavaNet-mirror (http://maven:8081/nexus/content/repositories/Java.net/), 
18-Oct-2012 22:50:31 Releases (https://nexus:8443/nexus/content/repositories/releases/) 
18-Oct-2012 22:50:31 
18-Oct-2012 22:50:31 Path to dependency: 
18-Oct-2012 22:50:31 1) dummy:dummy:jar:1.0 
Willson answered 23/10, 2012 at 16:0 Comment(1)
Run mvn dependency:tree and see where dummy:dummy:jar:1.0 is coming from.Burnie
L
3

It sounds like a network problem.

Either something is blocking the internet access (a firewall or antivirus, just disable that temporarily to download the dependencies).

Or the jar is to big to be downloaded, from http://maven.apache.org/wagon/wagon-providers/wagon-http-lightweight/

Known Limitation:

The main limitation is that you can't download data that doesn't fit entirely into memory.

A fix for this is to increase the memory for Maven:

export MAVEN_OPTS="-Xmx1024m"

See: Maven failing to download jar dependencies

Latrishalatry answered 28/5, 2013 at 14:45 Comment(3)
This worked for me. I wasnt connected to internet when I ran mvn clean install but after reading your answer I tried connecting to internet and re-tried, it worked.Joaquin
This specific answer helped me (older build): https://mcmap.net/q/402290/-maven-failing-to-download-jar-dependenciesCanuck
@KimballRobinson I've added more details to the answer based on your comment, thank you.Latrishalatry
S
3

We had a similar problem where a developer had put a class with the name of "TestUtil" in the test hierarchy, when the class wasn't actually related to unit testing at all. Renaming the class into something that didn't contain Test prefix fixed the issue for us. Don't know what it is about though.

AFAIK dummy.jar is something used internally by surefire plugin but is normally never exposed to end user. "dummy.jar" can be seen in surefire plugin source code (example1 and example2)

So in our case the class "TestUtil" caused the problem to appear, leading to similar situation, but to verify it's not something more logical always do a run of maven with -X debug log flag set.

Splanchnology answered 16/10, 2013 at 11:40 Comment(6)
@b.long care to clarify?Splanchnology
Sure, sorry for the downvote (I can't undo it now). I researched it a bit more and I think you might be onto something, but I'm not convinced you're right. A google search does seem to show that this issue is related to unit testing (specifically surefire).Bootless
I like @Burnie comment although I don't know if it would help anyone get to the root of the problem in this case. I tried it in my environment and can't find anything depending on dummy.jar, however my network was bad yesterday and so I'm inclined to this may in fact be related to network issue as described in this answer.Bootless
@b.long I expanded my answer a bit. The reason I think that comment is wrong is that dummy.jar is used by surefire plugin internally - it shouldn't be exposed to end user, but for some reason, in some cases it is doing so.Splanchnology
Well, you've won me over :) Thanks for the edit, I'm a big fan of making SO content better and better. I was feeling grumpy when I originally down-voted.Bootless
I had same problem if test classes names contains "Test" at begin or at end - it does not matter.Cussed
W
1

In my case I wasn't specifying the version of the surefire plugin. e.g.:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <includes>
                    <include>**/*_UT.java</include>
                    <include>**/*_FT.java</include>
                </includes>
            </configuration>
        </plugin>
    </plugins>
</build>

... which works great. But then I upgraded my Maven command-line client and got this. The solution varies depending on what you want to do (add missing artifact to your corporate repo, hard-code the surefire version, downgrade Maven), but understanding the why was the important part for me.

Hope this helps someone out there.

Whopping answered 28/3, 2016 at 17:20 Comment(1)
My team also ran into this bizarre error when someone failed to specify the surefire version in a new pom. What an atrocious way to fail...shaking my head at maven and surefire...Crystalloid
S
0

i had the same problem, and checked what version of surefire-junit4 we had available in our nexus. it was 2.12, and i declared 2.17 version for my maven-surefire-plugin. I think this in turn depends on surefire-junit4 version 2.17, which could not be got from our nexus. whatever it was, was very frustrating, but went away as soon as i downgraded by surefire plugin version to 2.12, for which the correct surefire-junit4 dependency could be downloaded from our nexus and then all was fine and dandy.

seems like you don't have the 2.12 available, so perhaps you'll have to go back to whatever is available in your nexus.

Spain answered 21/11, 2014 at 16:32 Comment(0)
J
0

My problem was solved by purging and reinstalling ca certificates from java-oracle on ubuntu i just followed answer

https://mcmap.net/q/50017/-is-the-cacerts-file-missing-in-ubuntu-15-10-and-openjdk-8-jdk

$ sudo dpkg --purge --force-depends ca-certificates-java
$ sudo apt-get install ca-certificates-java
Janel answered 26/7, 2018 at 6:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.