Tag Archives: maven

[Solved] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

There is a mave aggregation project. The following error is reported when packaging through the maven command:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

The packaging command is as follows: clean package

Solution 1:
Click Toggle ‘Skip Tests’ mode in the maven panel in idea tools, and package it again and it works fine.
Solution 2:
Specify skipTests as true in the pom file to skip unit tests

	<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
        </plugins>
    </build>

Solution 3:
Execute the command at the Terminal

mvn install -DskipTests

Solution 4:
Execute the command at the Terminal

mvn install -Dmaven.test.skip=true

Solution 5:
In the springboot project, spring-boot-maven-plugin plugin has been integrated with the maven-surefire-plugin plugin, will automatically run junit test, you need to add the following configuration in the pom

<properties>
 	<!-- skip the test -->
    <skipTests>true</skipTests>
</properties>

Among them, -Dmaven.test.skip=true and -DskipTests have the following roles

  • -DskipTests: does not execute the test cases, but compiles the test case classes to generate the corresponding class files under target/test-classes.
  • -Dmaven.test.skip=true: does not execute the test cases and does not compile the test case classes.

Spring Security Upgrade to Version 5.5.7, 5.6.4 or Above to Startup Error (Version incompatibility)

1. Background

Version comparison detection principle: check whether the current system version of spring-security-web is within the scope of the vulnerability version|version comparison detection results: – spring-security-web
Current installed version: 5.2.1.RELEASE
Need to upgrade to 5.5.7, 5.6.4 and above, because the pom can not find a direct reference to the location, so add the following dependencies to spring-security-web version forced to upgrade to 5.5.7

    <!-- Fix spring-security-web version vulnerability -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>5.5.7</version>
    </dependency>

An error is reported during startup. The error contents are as follows:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.security.web.util.matcher.OrRequestMatcher.<init>(OrRequestMatcher.java:43)

The following method did not exist:

    org.springframework.util.Assert.noNullElements(Ljava/util/Collection;Ljava/lang/String;)V

The method's class, org.springframework.util.Assert, is available from the following locations:

    jar:file:/C:/Users/sutpc/.m2/repository/org/springframework/spring-core/5.1.18.RELEASE/spring-core-5.1.18.RELEASE.jar!/org/springframework/util/Assert.class

It was loaded from the following location:

    file:/C:/Users/sutpc/.m2/repository/org/springframework/spring-core/5.1.18.RELEASE/spring-core-5.1.18.RELEASE.jar

2. Analysis of the cause

Theoretically, spring-security-web is introduced in a jar, and the version of spring-security-web is changed separately, resulting in the incompatibility of the supporting code in this jar.

3. Solutions

Upgrade spring-boot-dependencies from 2.1.17.RELEASE to 2.2.2.RELEASE
            <! -- SpringBoot dependency configuration-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
<!--                <version>2.1.17.RELEASE</version>-->
                <version>2.2.2.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
Just use the 5.5.7 mandatory override of spring-security-web at the end of the pom
        <! -- Fix spring-security-web version vulnerability -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>5.5.7</version>
        </dependency>

4. solution ideas:
Because a separate change in the version of spring-security-web, resulting in this jar incompatible with the code caused by the problem, so the primary problem need to find spring-security-web by which jar introduced

4.1 Query the Maven project to find out which dependency the jar package is introduced by
Use mvn dependency:tree directly to see the complete dependency tree of the project.

    Command format
mvn dependency:tree -Dverbose -Dincludes=Content to be queried(groupId:artifactId)

-dependency:tree:Indicates a tree-like display.
-Dverbose:Indicates that all references can be displayed, including those that are ignored because of multiple reference duplicates.
-Dincludes: you can formulate query conditions

The groupId and artifactId of spring-security-web are:

groupId: org.springframework.security
artifactId: spring-security-web
so the command is as below:
mvn dependency:tree -Dverbose -Dincludes=org.springframework.security:spring-security-web

4.2 The dependency hierarchy after execution in the idea’s Teminal is shown in the figure below

4.3spring-security-web is introduced by spring-boot-starter-security
spring-security-web is introduced by spring-boot-starter-security, version 2.1.17.RELEASE, search spring-boot-starter-security and find that it uses spring-boot- RELEASE.pom version

4.3spring-boot-starter-security version is the version that inherits spring-boot-dependencies
In the global search spring-boot-dependencies version, found really is 2.1.17.RELEASE, so far, all the dependency levels are found, that began to guess, is not spring-boot-dependencies version is too low, spring-security-web version is too high incompatible, spring-security-web version can not be adjusted down, can only upgrade the version of spring-boot-dependencies, in the maven repository to find the version of spring-boot-dependencies, level by level test, found 2.2.2. The problem is solved.

IDEA Maven Fail to Download Dependencies Error: ERROR – #org.jetbrains.idea.maven – Cannot reconnect.

Full Error Log:

2022-09-29 16:35:52,637 [  41134]  ERROR -      #org.jetbrains.idea.maven - Cannot reconnect. 
java.lang.RuntimeException: Cannot reconnect.
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:82)
	at org.jetbrains.idea.maven.server.MavenServerManager.applyProfiles(MavenServerManager.java:526)
	at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:394)
	at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:103)
	at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:62)
	at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:655)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:555)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:500)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:461)
	at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:432)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessorReadingTask.perform(MavenProjectsProcessorReadingTask.java:60)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:132)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:32)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:107)
	at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:449)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is: 
	java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: 
	java.net.ConnectException: Connection refused: connect
	at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:161)
	at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:66)
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
	at org.jetbrains.idea.maven.server.MavenServerManager.lambda$applyProfiles$3(MavenServerManager.java:526)
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
	... 20 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: 
	java.net.ConnectException: Connection refused: connect
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
	at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
	at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
	at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
	at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
	at com.intellij.execution.rmi.RemoteProcessSupport.lambda$acquire$2(RemoteProcessSupport.java:260)
	at com.intellij.openapi.util.ClassLoaderUtil.runWithClassLoader(ClassLoaderUtil.java:66)
	at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:231)
	at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:258)
	at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:164)
	at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:158)
	... 24 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at java.net.Socket.connect(Socket.java:538)
	at java.net.Socket.<init>(Socket.java:434)
	at java.net.Socket.<init>(Socket.java:211)
	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
	... 34 more

Solution:
1.IntelliJ IDEA –> Preferences –> Build,Execution,Deployment –> Build Tools –> Maven –> Importing –>JDK for importer select the JDK version that We installed

If the problem is not solved, perform the following two actions
2.maven -> Importing -> VM options for importer
-Xmx768m -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Djava.net.preferIPv4Stack=true

3. maven -> Runner -> VM Options
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -Djava.net.preferIPv4Stack=true

Here the JRE originally selected Project JDK, I changed to JAVA_HOME, I do not know if there is no effect, and finally is successful without error.

[2022 New Solution] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder

Problem introduction:

insert image description here

Problem Analysis:

According to the error message, we can know that the cause of the error is “failed to load the class file org.slf4j.impl.StaticLoggerBinder”, and the error mainly lies in the jar package of slf4j.

Official website explanation:

This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop .jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.

 

Solution:

Add a dependency configuration of one of the above package files to the pom file of the Maven project, as follows:

<dependency span>>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-nop</artifactId>
  <version>1.7.2</version>
</dependency> 

Over!!!

[Solved] Maven Project Packaging Error: Unable to find main class

I. Description of the problem

When I use the Maven aggregation project to package the parent project for packaging, I get an error :Unable to find main class which probably means that the main startup class cannot be found

insert image description here

2. How to Solve

The project contains modules of some tool classes, and the tool class modules do not need us to be started, It is only provided for other interface service references, No need to start means no main startup class, but the pom file of the parent project references the springboot packaging plugin spring-boot-maven-plugin, namely:

 <plugins> 
            <plugin>
                <groupId>org.springframework.boot</ groupId>
                <artifactId>spring-boot-maven-plugin&lt ;/artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId&gt ;
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>

So when packaging, mvn will scan all dependent modules. If it finds that there is no main startup class under a module, it will report an error.

3. Solution

My solution is: Comment out the packaged plugin spring-boot-maven-plugin of the parent project and then package/install it

Insert picture description here
You can see that the packaging is successful

[Solved] IDEA Maven Error: Cannot resolve xxx & Maven Dependencies Error

Prerequisites

Premise: Make sure the dependencies in Maven are correct, Don’t make mistakes such as missing letters.
If you are worried, you can go to the official website to search, and copy and paste it again.
Official website link: https://mvnrepository.com/

scene

Importing a new project,or other reasons,maven refresh is also useless, it reports error as show below:

Solution:

1. First, Clear the cache, Click and restart IDEA.

2. Close IDEA, Open the project folder

Find .idea in the project, delete workspace.xml

3. Re-open IDEA, find Maven on the right

Double-click clean

Wait for the console to appear BUILD SUCCESS

Find install under maven again, Double-click it and the download log shown below will appear.

Wait it over, and BUILD SUCCESS will appear:

Click the Reload button in the Maven component again, wait for the bottom progress bar to end

4. Solve the Dependencis report in Maven

First, Open the file pom.xml

Then delete the content in the tag dependencies [recommended to use Ctrl + x]

Click the Reload button in the Maven component again, wait for the bottom progress bar to finish. [dependencies disappears at this time]

Then in pom.xml, use the shortcut key Ctrl + z to return

(If you are using Ctrl + x , you can use Ctrl + v to paste)

Let the dependencies content appear again,return to the previous state.

The last step: click the Reload button in the Maven component again, wait for the bottom progress bar to finish. [At this time,dependencies appears and no longer reports an error]

Final effect:

Finally, it is solved.

How to Solve JasperFillManager.fillReport Stuck issue (No Error and No Processing)

The company’s use of irport configuration xml to generate .jasper suffix file and then organize the data for pdf generation. The project window environment does not report an error in the execution, placed on the liunx server sometimes encounter code stuck in the JasperFillManager.fillReport in this sentence does not move the case, and does not report an error throws an error nor backward execution. I have no idea how to troubleshoot the problem.

Today, I encountered this problem again, and solved the problem after the following troubleshooting process

1, the project itself is 5.6.0 jasperreports maven package configuration, suspected that the version is too low to store this problem, in order to verify I set up a new project, found a text on the Internet for the initial integration of code configuration is as follows

maven configuration to increase the configuration

<dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itext-pdfa</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itext-asian</artifactId>
            <version>5.2.0</version>
        </dependency>
        <dependency>
            <groupId>cn.lesper</groupId>
            <artifactId>iTextAsian</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.4.11</version>
        </dependency>
        <!-- jasperreports end-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.11.0</version>
        </dependency>

Test sample code

public static void main(String[] args) throws Exception {
        test();
    }
    public  static String test() throws JRException {

        Map map = (Map<String, Object>)new HashMap();
        List<Object> list = new ArrayList<>();
        String T1 = "1";
        String T2 = "2";
        String T3 = "3";
        String T4 = "4";
        BigDecimal T5 = new BigDecimal("0");
        log.error("Fetch public data");

        for (int i = 0; i < 10; i++) {
            Irportbean detail=new Irportbean();
            detail.setL1("1");//thisCopyDate
            detail.setL2("2");//writeOffDate
            detail.setL3("3");/preto
            detail.setL4("4");//thisto
            detail.setL5("5");//practicalWater
            detail.setL6("6");//netReceiptsWater
            detail.setL7("7");//basicsFeeUnitPrice
            detail.setL8("8");//basicsFeeMoney
            detail.setL9("9");//lateFee
            detail.setL10("cancelled");//cancellation flag isWriteOff
            list.add(detail);
        }
        JRDataSource data = new JRBeanCollectionDataSource(list);
        map.put("beans", data);
        map.put("T1", "test");
        map.put("T2", T2);
        map.put("T3", T3);
        map.put("T4", T4);
        map.put("T5", T5);
        log.error("---------------------------map :" + list.toString());

        // 3. print PDF
        String imageName = UUID.randomUUID() + ".pdf";
        log.error("==========");
        log.error(PATH + "gr_water_list.jasper");
        log.error(IAMGE_PATH + imageName);

        JasperPrint print = JasperFillManager.fillReport(PATH + "gr_water_list.jasper", map, new JREmptyDataSource());
        JasperExportManager.exportReportToPdfFile(print,IAMGE_PATH+imageName);
        log.error("---------------------------getName :" +  print.getName());
        String   url = YUMIN + "JxReport/temp_image/" + imageName;
        log.error("---------------------------url :" + url);
        return url;
    }

The code local window execution OK, and then packaged to the problem server through the interface test found that the normal generation of pdf, the initial confirmation of the text and the server is not related to confirm the version of the problem.

After confirming that the version of the project is integrated in accordance with the above configuration integrated into the existing project packaging test. The process also encountered two small problems

1, integration test local test no problem, put to the server found or not, found that eclipse using maven packaging if not prior to update maven and clean up the existing war, it will be the new version of the jar and the old version of the jar packaged together to war, you need to clean up the project maven. then repackaged, the phenomenon: war start after decompression lib directory See if the new package and the old jar exist at the same time, the existence of the old jar to remove, restart the project found that the problem is solved.

Maven Project Right-Click -update project Error [How to Solve]

Maven project, right-click -update project after the error reported the following solution:

1.Description ResourcePathLocationType

Java compiler level does not match the version of the installed Java project facet.SSMDemo Maven WebUnknownFaceted Project Problem (Java Version Mismatch)

2.Description ResourcePathLocationType

JAX-RS (REST Web Services) 2.0 requires Java 1.7 or newer.SSMDemo Maven Webline 1Maven Java EE Configuration Problem

3.Description ResourcePathLocationType

One or more constraints have not been satisfied.SSMDemo Maven Web line 1Maven Java EE Configuration Problem

 

Solution: Add the following codes in pom.xml

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7(Modify to your own JDK version)</source>
<target>1.7(Modify to your own JDK version)</target>
</configuration>
</plugin>
</plugins>

 

[Solved] ssm Error: Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: Executor was closed

Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: Executor was closed.

How to Solve SSM Error:  Error querying database Cause: org.apache.ibatis.executor. ExecutorException: Executor was closed.

Reason for error reporting

The method of querying Dao layer in impl of service layer is written in return, and sqlSession is closed on it

Solution:

Query the data before closing the resource

[Solved] org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject…

Error message:

org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration)

 

Solution:

Add and change the following plugin configuration in pom:

            </plugin>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.6</version>
                </plugin>  

How to Solve Spring Boot Maven Build Error

Error 1:

[ERROR]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project motherBuyBoot: There are test failures.
[ERROR] Please refer to D:\web\motherbuy\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.

Solution:

the pom.xml file has the wrong version of Junit, or for some other reason, the junit dependency is commented out and the compilation passes.

 

Error 2:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project motherBuyBoot: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Solution:

Method: Compile compile environment problems, that are not configured; see the screenshot below to solve, do not forget to update maven.

[Solved] MVN Build Project Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test

Error Messages:

Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test

[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ wls-exporter-core ---
Oct 16, 2021 7:34:54 AM org.sonatype.guice.bean.reflect.Logs$JULSink warn
WARNING: Error injecting: org.apache.maven.plugin.surefire.SurefirePlugin
com.google.inject.ProvisionException: Guice provision errors:

1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
  while locating org.apache.maven.plugin.surefire.SurefirePlugin

1 error
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1006)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032)
        at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
        at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
        at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
        at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
        at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
        at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
        at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
        at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
        at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
        at com.google.inject.Scopes$1$1.get(Scopes.java:59)
        at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
        at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.410s
[INFO] Finished at: Sat Oct 16 07:34:54 UTC 2021
[INFO] Final Memory: 21M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project wls-exporter-core: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
[ERROR] while locating org.apache.maven.plugin.surefire.SurefirePlugin
[ERROR] at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5, parent: sun.misc.Launcher$AppClassLoader@7852e922]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test

Solution

Upgrade maven to the latest version

Reference:
https://stackoverflow.com/questions/53211941/unable-to-load-the-mojo-test-org-apache-maven-pluginsmaven-surefire-plugin

Error message
maven plugin failed to parse: Could not transfer artifact XXX, transfer failed for XXX
Solution:
Finally add this to the maven parameters to solve the certificate problem on the line.
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true