Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test #8693

Closed
tibistibi opened this issue Oct 31, 2018 · 10 comments

Comments

@tibistibi
Copy link
Contributor

Overview of the issue

After the latest java upgrade on at least debain and ubuntu maven surefire plugin stops working with this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test (default-test) on project stand-bystand: There are test failures.
[ERROR]
[ERROR] Please refer to /home/tibi/git/char4/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /home/tibi/git/char4 && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -javaagent:/home/tibi/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/home/tibi/git/char4/target/test-results/coverage/jacoco/jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m -jar /home/tibi/git/char4/target/surefire/surefirebooter6488219923373782248.jar /home/tibi/git/char4/target/surefire 2018-10-31T13-40-05_490-jvmRun1 surefire6687084744045484879tmp surefire_01044511474891119345tmp

Motivation for or Use Case

Surefire team is working on a fix but in the mean time there is a work around. We could implement it until the plugin is fixed

Reproduce the error

Create any form of jhipster project with maven and run tests.

Related issues

Surefire manifest jar classloading broken on latest Debian/Ubuntu Java8
https://issues.apache.org/jira/browse/SUREFIRE-1588?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=16670286#comment-16670286

Suggest a Fix

added this line in to the pom.xml:

<useSystemClassLoader>false</useSystemClassLoader>

like this:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
            <!-- Force alphabetical order to have a reproducible build -->
            <runOrder>alphabetical</runOrder>
            <useSystemClassLoader>false</useSystemClassLoader>
        </configuration>
    </plugin>

Executing jhipster:info
Options: from-cli: true
Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
[email protected] /home/tibi/git/mvntest
└── [email protected] 

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "nl.tibi.sbys",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "5.5.0",
    "baseName": "standBystand",
    "packageName": "nl.tibi.sbys",
    "packageFolder": "nl/tibi/sbys",
    "serverPort": "8080",
    "authenticationType": "session",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": true,
    "enableSwaggerCodegen": false,
    "rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "clientFramework": "angularX",
    "useSass": false,
    "clientPackageManager": "npm",
    "applicationType": "monolith",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": [
      "en",
      "nl",
      "de"
    ]
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

git version 2.17.1

node: v8.11.3

npm: 6.2.0

yarn: 1.9.4

Browsers and Operating System

Ubuntu

  • [ x Checking this box is mandatory (this is just to show you read everything)
@atomfrede
Copy link
Member

Interesting, seen a discussion on twitter already about suddenly breaking builds.

@atomfrede
Copy link
Member

The fix is already merged upstream, but not sure how fast the next release is baked. So @tibistibi do you want to make a PR?

@tibistibi
Copy link
Contributor Author

tibistibi commented Nov 1, 2018 via email

tibistibi pushed a commit to tibistibi/generator-jhipster that referenced this issue Nov 1, 2018
This is a temporary fix until the surefire team have fixed this in a new version (after 2.22.1)
pascalgrimaud added a commit that referenced this issue Nov 1, 2018
resolve: Failed to execute goal maven-surefire #8693
@pascalgrimaud
Copy link
Member

Thanks, the fix had been merged #8714
We'll keep in mind to remove this additional line

For now, let's close this.

@tibistibi
Copy link
Contributor Author

it seems the linux openjdk team has reverted the change:

The problem seems to have been resolved upstream if you update the OpenJDK package. (For me, from 1.8.0_181-8u181-b13-1ubuntu0.18.10.1-b13 to 1.8.0_191-8u191-b12-0ubuntu0.18.10.1-b12.)

https://issues.apache.org/jira/browse/SUREFIRE-1588

so we can revert the change (tested it on my system) but we can also wait a bit to be sure everyone will have the new openjdk

in all cases it is fixed (even with strict setting in java) in the new surfiere plugin so we can also wait when jhipster is using version 3.0.0-M1 (now 2.22.0)

i think it is best to wait a bit there seems no real problem with the temp fix.

@DanielFran
Copy link
Member

Sufire maven plugin is updated in spring-boot 2.1 branch.

@ishaq8283
Copy link

not working for me

@ishaq8283
Copy link

org.apache.maven.plugins maven-surefire-plugin 2.21.0 0 -Xmx1024m -XX:MaxPermSize=256m src/test/resources/runner/testng.xml

@ajaysjournal
Copy link

what is the correct fix for this error, any details?

@gmarziou
Copy link
Contributor

@ajay443

Please don't comment on an old issue.
If you think this issue still applies, please create a new ticket with proper details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants