Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1289

Can't run JUnit test after making changes when using Lombok

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 9.0
    • 9.0
    • java - JUnit
    • None
    • NetBeans 9, JDK 10

    Description

      Using Lombok in a Maven JAR project (using JDK 8 or JDK 10), you can't run a test file after making changes to it. When saving the changes and running the test, the following error shows:

      --- maven-surefire-plugin:2.12.4:test (default-cli) @ lombok-netbeans9 ---
      ------------------------------------------------------------------------
      BUILD FAILURE
      ------------------------------------------------------------------------
      Total time: 0.368 s
      Finished at: 2018-09-23T22:43:47-03:00
      Final Memory: 7M/34M
      ------------------------------------------------------------------------
      Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-cli) on project lombok-netbeans9: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]

      After that, you have to clean the whole project to run the tests again.

      I've attached a simple project that reproduces this problem.

      How to reproduce

      1. Open NetBeans 9
      2. Go to File > New project > Maven > Java Application and create a basic project
      3. Open pom.xml and add lombok as depedency:
                <dependency>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok</artifactId>
                    <version>1.18.2</version>
                    <scope>provided</scope>       
                </dependency>
      4. Create a simple JUnit test with a test method (@Test)
      5. Run the test and confirm it runs fine.
      6. Make a simple change to the test method and save it.
      7. Run the test, and the error shows.

       

      Attachments

        1. lombok-netbeans9.zip
          3 kB
          Leonardo De Seta

        Activity

          People

            Unassigned Unassigned
            ldeseta Leonardo De Seta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: