I have 2 different JAVA 11 child projects based on the same parent maven pom.xml.
The first one was set up with Spring initializer for Maven from the beginning and the second one was set up initially without SpringBoot.
The second one was giving me headaches because it was missing some dependencies (JAI, JPEG2000) which were in the parent pom.xml and well included in the first project which used Spring maven plugin to package the app, but not in the second one.
That's why I decided to move the second project to SpringBoot. But it still misses the same dependencies as previously and when I print the loaded classes it still shows : /home/path/to/netbeans/java/maven/boot/plexus-classworlds-2.6.0.jar
(I am using Netbeans 12) whereas the first project lists all loaded jars as it is expected to do. This second project pom.xml reads as follows :
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>My.Package</groupId>
<artifactId>PyProg</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>My prog Name</name>
<description>SpringBoot version of My Prog</description>
<parent>
<artifactId>MySuperParent</artifactId>
<groupId>My.Package</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<!--Uses a different parent than Spring Boot one see https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-maven-without-a-parent-->
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.16.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>My.Package</groupId>
<artifactId>Base</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<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>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11.0.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>${junitVersion}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.2</version>
<type>maven-plugin</type>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<!--Resource folder that should be included-->
<directory>src/main/resources</directory>
<!--Resources that should not-->
<excludes>
<exclude>solo/**</exclude>
<exclude>forYourEyesOnly/**</exclude>
</excludes>
</resource>
</resources>
<plugins>
<!-- Package as an executable jar -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.16.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Plexus-classworlds is not in any pom, both projects pom look alike now that I moved the second one to SpringBoot, so how can I disable plexus-classworlds and get rid of it, so that when doing System.out.println(System.getProperty("java.class.path").replace(":","\n"));
to get the loaded classes from class path, I see a list not this single plexus-classworlds jar ?
I believe I may have messed up with some config file sometime in the past that enabled this plexus-classworlds, but I can't remember.
I tried to remove this jars from Netbeans but then none of the projects boots up.
So could somebody tell me how to get rid of plexus-classworlds.jar shown in the classpath ?
Any hint appreciated!