You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bruno Melloni <x....@melloni.com> on 2022/01/25 16:33:34 UTC

Strange ClassCastException during maven install

I wrote and used a custom library that includes some log4j aware 
classes.  Was working perfectly when built as a standard Java JAR.  I am 
converting the POM to rely on a few Spring Boot starters as a way to 
simplify it.

All went well until I run "Maven Install", when I got the following 
ClassCastException even though my code never uses slf4j:  "*class 
org.apache.logging.slf4j.SLF4JLogger cannot be cast to class 
org.apache.logging.log4j.core.Logger 
(org.apache.logging.slf4j.SLF4JLogger and 
org.apache.logging.log4j.core.Logger are in unnamed module of loader 
'app')*"

The issue is probably trivial and I suspect that one or more of the 
starters (possibly the TEST portion) relies on slf4j and I somehow need 
to provide a library to accept slf4j and automatically convert to log4j 
logging.

Can anybody see where I messed up, and know how to fix it?

*This is the old (good) POM*:

<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>
   <groupId>net.cndc</groupId>
   <artifactId>libCore</artifactId>
   <version>0.0.1-SNAPSHOT</version>

   <properties>
     <oshi.version>5.8.2</oshi.version>
   </properties>

   <dependencies>
     <!-- Apache commons -->
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-text</artifactId>
       <version>1.9</version>
     </dependency>
     <!-- Log4j -->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
       <version>2.15.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>2.15.0</version>
     </dependency>

     <!-- JJWT, library to add JWT bearer token support -->
     <dependency>
       <groupId>io.jsonwebtoken</groupId>
       <artifactId>jjwt</artifactId>
       <version>0.9.1</version>
     </dependency>
     <dependency>
       <groupId>javax.xml.bind</groupId>
       <artifactId>jaxb-api</artifactId>
       <version>2.3.1</version>
     </dependency>

     <!-- Jackson JSON -->
     <dependency>  <!-- Jackson -->
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
       <version>2.12.5</version>
     </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
       <version>4.5.13</version>
     </dependency>

     <!-- Server compatible -->
     <dependency> <!-- Servlet API -->
       <groupId>javax.servlet</groupId>
       <artifactId>javax.servlet-api</artifactId>
       <version>4.0.1</version>
       <scope>provided</scope>
     </dependency>

     <!--  Spring -->
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-jdbc</artifactId>
       <version>5.3.9</version>
     </dependency>
     <!-- SpringSecurity -->
     <dependency>
       <groupId>org.springframework.security</groupId>
       <artifactId>spring-security-web</artifactId>
       <version>5.5.2</version>
     </dependency>
     <dependency>
       <groupId>org.springframework.security</groupId>
       <artifactId>spring-security-core</artifactId>
       <version>5.5.2</version>
     </dependency>
     <dependency>
       <groupId>org.springframework.security</groupId>
       <artifactId>spring-security-config</artifactId>
       <version>5.5.2</version>
     </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-jdbc</artifactId>
       <version>5.3.10</version>
     </dependency>

     <dependency>
       <groupId>com.github.oshi</groupId>
       <artifactId>oshi-core</artifactId>
       <version>${oshi.version}</version>
     </dependency>

     <!-- Misc -->
     <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
         <version>3.12.0</version>
     </dependency>

     <!-- Other -->
     <dependency> <!-- JUnit -->
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.13.2</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

   <build>
     <pluginManagement>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
           <version>3.8.1</version>
           <configuration>
             <release>15</release>
           </configuration>
         </plugin>
       </plugins>
     </pluginManagement>
   </build>

</project>

*And this is the POM that causes the error*:

  <?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.6.3</version>
      <relativePath/> <!-- lookup parent from repository -->
     </parent>
     <groupId>net.cndc</groupId>
     <artifactId>core-lib</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <name>core-lib</name>
     <description>Core library for all CNDC apps</description>

     <properties>
         <java.version>17</java.version>
     <oshi.version>5.8.2</oshi.version>
     </properties>

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

     <!-- Apache commons -->
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-text</artifactId>
       <version>1.9</version>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
     </dependency>
     <!-- Log4j -->
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
     </dependency>
     <!-- Hardware -->
     <dependency>
       <groupId>com.github.oshi</groupId>
       <artifactId>oshi-core</artifactId>
       <version>${oshi.version}</version>
     </dependency>
     <!-- Jackson JSON -->
     <dependency>  <!-- Jackson -->
       <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-databind</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
     </dependency>
     <!-- Spring -->
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-jdbc</artifactId>
     </dependency>

   </dependencies>

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

</project>

Re: SOLVED: Strange ClassCastException during maven install

Posted by Nils Breunese <ni...@breun.nl>.
Bruno <x....@melloni.com> wrote:

> I read that BOM article and many others that I googled.  If I understood correctly, it seems that the ideal POM structure is:
> 
> * To have a master BOM POM that specifies key library versions and
>   pre-supplied BOMs (like  spring-framework-bom) in the
>   dependencyManagement section.
> * Maybe have a couple "parent" POMs for the different types of
>   projects (like REST service, webapp) that inherit from the master
>   BOM POM.
> * And finally inheriting from one of those parent POMs in the
>   individual project POMs.
> 
> *First question*:  Is that correct?

I’m sorry, but I don’t have enough information about your goals to answer your question. Before I was under the impression that you were creating a single library, but it seems that you plan on creating something more complex, possibly a multi-module project?

A BOM is basically a POM which only consists of a dependencyManagement section to be included elsewhere. You should generally create a BOM artifact yourself if you have a multi-module project, and you should only include your own project’s artifacts in this BOM. This BOM is a service for consumers of your multi-module project, because instead of having to add all individual modules to their project’s dependencyManagement section, they can just import a single BOM artifact and then depend on any module from that multi-module project, without having to specify its version.

You can see that for instance the Spring Boot Dependencies BOM also imports a lot of BOMs from other projects itself (kotlin-bom, reactor-bom, etc.): https://search.maven.org/artifact/org.springframework.boot/spring-boot-dependencies/2.6.3/pom

When you want to use Spring Boot’s dependencyManagement into your own project, you need to import it like this into your pom.xml file, and this transitively imports all dependencyManagement which spring-boot-dependencies contains:

——
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-dependencies</artifactId>
      <version>2.6.3</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>
——

This import will allow you to add any dependency managed by Spring Boot 2.6.3 without having to specify the version in your project. For instance, to add a dependency on the Kotlin Coroutine core module:

——
<dependencies>
  <dependency>
    <groupId>org.jetbrains.kotlinx</groupId>
    <artifactId>kotlinx-coroutines-core</artifactId>
  </dependency>
</dependencies>
——

If you plan on creating a multi-module project and you want to use a third-party BOM for all of your project’s submodules, then it might make sense to create a ‘parent’ module in your multi-module project which imports for instance the spring-boot-dependencies BOM, and then your submodules can use this parent module as their parent.

Another option is to create a parent module for your own multi-module project which uses spring-boot-starter-parent as its parent. As you can see spring-boot-starter-parent uses spring-boot-dependencies as its parent: https://search.maven.org/artifact/org.springframework.boot/spring-boot-starter-parent/2.6.3/pom By using spring-boot-starter-parent are your own multi-module's parent’s parent you not only import dependencyManagement from spring-boot-dependencies, but also all Maven plugin stuff in spring-boot-starter-parent, which may or may not be what you want.

> *Second question*:  Where do I place the master BOM POM and the Parent POMs so that they end up in the local Maven repository and visible to project builds?  I suspect that the answer might be to create a dummy Eclipse project with multiple POMs and no code, then use something like the following but I am not sure:
> 
> |||<||parent||>|
> |||<||groupId||>com.mydomain</||groupId||>|
> |||<||artifactId||>poms</||artifactId||>|
> |||<||version||>0.0.1-SNAPSHOT</||version||>|
> |||<||relativePath||>bom-pom.xml</||relativePath||>|
> |||</||parent||>|
> |||<||parent||>|
> |||<||groupId||>com.mydomain</||groupId||>|
> |||<||artifactId||>poms</||artifactId||>|
> |||<||version||>0.0.1-SNAPSHOT</||version||>|
> |||<||relativePath||>parent-rest-pom.xml</||relativePath||>|
> |||</||parent||>|

It doesn’t really matter where you place them. You could have the parent and BOM modules in separate projects, or as part of a multi-module project. If you look at the Spring Cloud project for instance, you’ll see that have their spring-cloud-dependencies BOM and spring-cloud-starter-parent modules in a separate spring-cloud-release repository: https://github.com/spring-cloud/spring-cloud-release But Spring Boot has its spring-boot-dependencies and spring-boot-parent modules in the same project as a bunch of other Spring Boot modules: https://github.com/spring-projects/spring-boot/tree/main/spring-boot-project

After you install any Maven module in your local Maven repository (or even better: publish it to your local Maven artifact manager), your other modules should be to use it. If they are all part of the same multi-module project, then all modules in the same should be able to use them directly, without first needing to install them.

I realize this is all maybe a bit too much information at once, and maybe I haven’t really answered your questions yet. If you can let us know more about what exactly you’re trying to achieve, we may be able to help you with more focused issues.

Nils.

> On 1/26/2022 5:26 AM, Nils Breunese wrote:
>> Bruno Melloni<x....@melloni.com>  wrote:
>> 
>>> If I understood the explanation, it seems that the spring boot starter (parent) defaults to slf4j and that the code above removes that support while replacing it with log4j2.
>> I don’t know what your goals are for this library, but I do wonder if it’s a good idea to let a library depend on Spring Boot starters. I would expect that more gets pulled in than you actually want or need, as you’ve found. Spring Boot starters are just artifacts that depend on one ore more other artifacts and are generally meant to be used by applications. Libraries typically depend on one or more those ‘lower level’ artifacts directly to explicitly define what they depend on and not pull in too much.
>> 
>> I maintain an in-house framework based on Spring Boot myself and I’d recommend importing the spring-boot-dependencies BOM of the Spring Boot version you’re targeting with your library into your library’s <dependencyManagement> section. That will allow you to use any dependency managed by Spring Boot without having to specify its version.
>> 
>> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms
>> 
>> Nils.
>> 
>> P.S. I notice your old POM uses Log4J 2.15.0, which is vulnerable to the pretty serious Log4Shell vulnerabilities.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: SOLVED: Strange ClassCastException during maven install

Posted by Bruno <x....@melloni.com>.
Thank you Nils,

I apologize for my ignorance, as I am still fairly new to Maven. I 
understand the basics well enough but it is very obvious to me that 
there is a lot of specialized knowledge that is assumed and not well 
explained in most of the tutorials/guides I googled.

My library is a primary component of an in-house framework like yours.  
I am at the start of modernizing and strengthening security of the 
framework and all of my older projects from plain Java 8+Spring to 
Maven, Java 17, Spring Boot, strong/secure authentication mechanisms, 
and relying on a vault.  I am not *yet* migrating to Docker and 
Kubernetes (since my upper management did not approve it and also 
because it would be a steep learning curve on top of the other new 
things) but that seems to be a natural next step.

I read that BOM article and many others that I googled.  If I understood 
correctly, it seems that the ideal POM structure is:

  * To have a master BOM POM that specifies key library versions and
    pre-supplied BOMs (like  spring-framework-bom) in the
    dependencyManagement section.
  * Maybe have a couple "parent" POMs for the different types of
    projects (like REST service, webapp) that inherit from the master
    BOM POM.
  * And finally inheriting from one of those parent POMs in the
    individual project POMs.

*First question*:  Is that correct?

*Second question*:  Where do I place the master BOM POM and the Parent 
POMs so that they end up in the local Maven repository and visible to 
project builds?  I suspect that the answer might be to create a dummy 
Eclipse project with multiple POMs and no code, then use something like 
the following but I am not sure:

|||<||parent||>|
|||<||groupId||>com.mydomain</||groupId||>|
|||<||artifactId||>poms</||artifactId||>|
|||<||version||>0.0.1-SNAPSHOT</||version||>|
|||<||relativePath||>bom-pom.xml</||relativePath||>|
|||</||parent||>|
|||<||parent||>|
|||<||groupId||>com.mydomain</||groupId||>|
|||<||artifactId||>poms</||artifactId||>|
|||<||version||>0.0.1-SNAPSHOT</||version||>|
|||<||relativePath||>parent-rest-pom.xml</||relativePath||>|
|||</||parent||>|


On 1/26/2022 5:26 AM, Nils Breunese wrote:
> Bruno Melloni<x....@melloni.com>  wrote:
>
>> If I understood the explanation, it seems that the spring boot starter (parent) defaults to slf4j and that the code above removes that support while replacing it with log4j2.
> I don’t know what your goals are for this library, but I do wonder if it’s a good idea to let a library depend on Spring Boot starters. I would expect that more gets pulled in than you actually want or need, as you’ve found. Spring Boot starters are just artifacts that depend on one ore more other artifacts and are generally meant to be used by applications. Libraries typically depend on one or more those ‘lower level’ artifacts directly to explicitly define what they depend on and not pull in too much.
>
> I maintain an in-house framework based on Spring Boot myself and I’d recommend importing the spring-boot-dependencies BOM of the Spring Boot version you’re targeting with your library into your library’s <dependencyManagement> section. That will allow you to use any dependency managed by Spring Boot without having to specify its version.
>
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms
>
> Nils.
>
> P.S. I notice your old POM uses Log4J 2.15.0, which is vulnerable to the pretty serious Log4Shell vulnerabilities.

Re: SOLVED: Strange ClassCastException during maven install

Posted by Nils Breunese <ni...@breun.nl>.
Bruno Melloni <x....@melloni.com> wrote:

> If I understood the explanation, it seems that the spring boot starter (parent) defaults to slf4j and that the code above removes that support while replacing it with log4j2.

I don’t know what your goals are for this library, but I do wonder if it’s a good idea to let a library depend on Spring Boot starters. I would expect that more gets pulled in than you actually want or need, as you’ve found. Spring Boot starters are just artifacts that depend on one ore more other artifacts and are generally meant to be used by applications. Libraries typically depend on one or more those ‘lower level’ artifacts directly to explicitly define what they depend on and not pull in too much.

I maintain an in-house framework based on Spring Boot myself and I’d recommend importing the spring-boot-dependencies BOM of the Spring Boot version you’re targeting with your library into your library’s <dependencyManagement> section. That will allow you to use any dependency managed by Spring Boot without having to specify its version.

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms

Nils.

P.S. I notice your old POM uses Log4J 2.15.0, which is vulnerable to the pretty serious Log4Shell vulnerabilities.

SOLVED: Strange ClassCastException during maven install

Posted by Bruno Melloni <x....@melloni.com>.
Was tricky to find through google, but I found that replacing the log4j 
entries in the new POM (bottom of the original email) with the following 
will solve the issue:

     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter</artifactId>
       <exclusions>
         <exclusion>
           <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
         </exclusion>
       </exclusions>
     </dependency>
     <dependency>
       <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
     </dependency>

If I understood the explanation, it seems that the spring boot starter 
(parent) defaults to slf4j and that the code above removes that support 
while replacing it with log4j2.


On 1/25/2022 11:33 AM, Bruno Melloni wrote:
>
> I wrote and used a custom library that includes some log4j aware 
> classes.  Was working perfectly when built as a standard Java JAR.  I 
> am converting the POM to rely on a few Spring Boot starters as a way 
> to simplify it.
>
> All went well until I run "Maven Install", when I got the following 
> ClassCastException even though my code never uses slf4j:  "*class 
> org.apache.logging.slf4j.SLF4JLogger cannot be cast to class 
> org.apache.logging.log4j.core.Logger 
> (org.apache.logging.slf4j.SLF4JLogger and 
> org.apache.logging.log4j.core.Logger are in unnamed module of loader 
> 'app')*"
>
> The issue is probably trivial and I suspect that one or more of the 
> starters (possibly the TEST portion) relies on slf4j and I somehow 
> need to provide a library to accept slf4j and automatically convert to 
> log4j logging.
>
> Can anybody see where I messed up, and know how to fix it?
>
> *This is the old (good) POM*:
>
> <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>
>   <groupId>net.cndc</groupId>
>   <artifactId>libCore</artifactId>
>   <version>0.0.1-SNAPSHOT</version>
>
>   <properties>
>     <oshi.version>5.8.2</oshi.version>
>   </properties>
>
>   <dependencies>
>     <!-- Apache commons -->
>     <dependency>
>       <groupId>org.apache.commons</groupId>
>       <artifactId>commons-text</artifactId>
>       <version>1.9</version>
>     </dependency>
>     <!-- Log4j -->
>     <dependency>
>       <groupId>org.apache.logging.log4j</groupId>
>       <artifactId>log4j-api</artifactId>
>       <version>2.15.0</version>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.logging.log4j</groupId>
>       <artifactId>log4j-core</artifactId>
>       <version>2.15.0</version>
>     </dependency>
>
>     <!-- JJWT, library to add JWT bearer token support -->
>     <dependency>
>       <groupId>io.jsonwebtoken</groupId>
>       <artifactId>jjwt</artifactId>
>       <version>0.9.1</version>
>     </dependency>
>     <dependency>
>       <groupId>javax.xml.bind</groupId>
>       <artifactId>jaxb-api</artifactId>
>       <version>2.3.1</version>
>     </dependency>
>
>     <!-- Jackson JSON -->
>     <dependency>  <!-- Jackson -->
>       <groupId>com.fasterxml.jackson.core</groupId>
>       <artifactId>jackson-databind</artifactId>
>       <version>2.12.5</version>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.httpcomponents</groupId>
>       <artifactId>httpclient</artifactId>
>       <version>4.5.13</version>
>     </dependency>
>
>     <!-- Server compatible -->
>     <dependency> <!-- Servlet API -->
>       <groupId>javax.servlet</groupId>
>       <artifactId>javax.servlet-api</artifactId>
>       <version>4.0.1</version>
>       <scope>provided</scope>
>     </dependency>
>
>     <!--  Spring -->
>     <dependency>
>       <groupId>org.springframework</groupId>
>       <artifactId>spring-jdbc</artifactId>
>       <version>5.3.9</version>
>     </dependency>
>     <!-- SpringSecurity -->
>     <dependency>
> <groupId>org.springframework.security</groupId>
>       <artifactId>spring-security-web</artifactId>
>       <version>5.5.2</version>
>     </dependency>
>     <dependency>
> <groupId>org.springframework.security</groupId>
>       <artifactId>spring-security-core</artifactId>
>       <version>5.5.2</version>
>     </dependency>
>     <dependency>
> <groupId>org.springframework.security</groupId>
> <artifactId>spring-security-config</artifactId>
>       <version>5.5.2</version>
>     </dependency>
>     <dependency>
>       <groupId>org.springframework</groupId>
>       <artifactId>spring-jdbc</artifactId>
>       <version>5.3.10</version>
>     </dependency>
>
>     <dependency>
>       <groupId>com.github.oshi</groupId>
>       <artifactId>oshi-core</artifactId>
>       <version>${oshi.version}</version>
>     </dependency>
>
>     <!-- Misc -->
>     <dependency>
>         <groupId>org.apache.commons</groupId>
>         <artifactId>commons-lang3</artifactId>
>         <version>3.12.0</version>
>     </dependency>
>
>     <!-- Other -->
>     <dependency> <!-- JUnit -->
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>4.13.2</version>
>       <scope>test</scope>
>     </dependency>
>   </dependencies>
>
>   <build>
>     <pluginManagement>
>       <plugins>
>         <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
>           <version>3.8.1</version>
>           <configuration>
>             <release>15</release>
>           </configuration>
>         </plugin>
>       </plugins>
>     </pluginManagement>
>   </build>
>
> </project>
>
> *And this is the POM that causes the error*:
>
>  <?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.6.3</version>
>      <relativePath/> <!-- lookup parent from repository -->
>     </parent>
>     <groupId>net.cndc</groupId>
>     <artifactId>core-lib</artifactId>
>     <version>0.0.1-SNAPSHOT</version>
>     <name>core-lib</name>
>     <description>Core library for all CNDC apps</description>
>
>     <properties>
>         <java.version>17</java.version>
>     <oshi.version>5.8.2</oshi.version>
>     </properties>
>
>   <dependencies>
>      <!-- starters -->
>     <dependency>
>       <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-security</artifactId>
>     </dependency>
>     <dependency>
>       <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-web</artifactId>
>     </dependency>
>     <dependency>
>       <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-test</artifactId>
>       <scope>test</scope>
>     </dependency>
>     <dependency>
> <groupId>org.springframework.security</groupId>
>       <artifactId>spring-security-test</artifactId>
>       <scope>test</scope>
>     </dependency>
>
>     <!-- Apache commons -->
>     <dependency>
>       <groupId>org.apache.commons</groupId>
>       <artifactId>commons-text</artifactId>
>       <version>1.9</version>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.commons</groupId>
>       <artifactId>commons-lang3</artifactId>
>     </dependency>
>     <!-- Log4j -->
>     <dependency>
>       <groupId>org.apache.logging.log4j</groupId>
>       <artifactId>log4j-api</artifactId>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.logging.log4j</groupId>
>       <artifactId>log4j-core</artifactId>
>     </dependency>
>     <!-- Hardware -->
>     <dependency>
>       <groupId>com.github.oshi</groupId>
>       <artifactId>oshi-core</artifactId>
>       <version>${oshi.version}</version>
>     </dependency>
>     <!-- Jackson JSON -->
>     <dependency>  <!-- Jackson -->
>       <groupId>com.fasterxml.jackson.core</groupId>
>       <artifactId>jackson-databind</artifactId>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.httpcomponents</groupId>
>       <artifactId>httpclient</artifactId>
>     </dependency>
>     <!-- Spring -->
>     <dependency>
>       <groupId>org.springframework</groupId>
>       <artifactId>spring-jdbc</artifactId>
>     </dependency>
>
>   </dependencies>
>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-maven-plugin</artifactId>
>       </plugin>
>     </plugins>
>   </build>
>
> </project>
>