Home > front end >  Select preferred launcher pops when lauching JUnit test
Select preferred launcher pops when lauching JUnit test

Time:11-22

I have created a Spring Initializr project: enter image description here

I import it to Eclipse IDE for Java Developers - Version: 2022-03 (4.23.0) - it's OK.

Then I launch JUnit test on my test class: enter image description here

Then I have this box popping up when I launch JUint test: enter image description here

Is it not supposed to be working without any further POM or Eclipse configuration?

The JDK on Window -> Preferences -> Installed JRE is : jdk-11

This is the POM generated by Spring Initializr

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.steph.spring</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>11</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

I don't know what to try since I expected it to work without any further POM or Eclipse configuration.

CodePudding user response:

It is working now with Eclipse IDE for Java Developers - Version: 2022-03 (4.23.0).

I have reinstalled it, open my spring boot project into it. The JUnit test is running correctly.

I have been comparing the two versions of eclipse configuration and I could not see anything different considering my actual knowledge of Eclipse.

May be it is when I had installed a Liferay plugin that something changed into my previous version of Eclipse and caused damage to JUnit launcher configuration.

CodePudding user response:

It's now working with : Eclipse IDE for Enterprise Java and Web Version: 2022-09 (4.25.0)

I still wonder why Eclipse IDE for Java Developers - Version: 2022-03 (4.23.0) needs to parametrize a launcher and also why the process to do so seems not working as well. Spring boot is not exclusively meant for web application so it should work straight forward.

  • Related