SoFunction
Updated on 2025-03-02

Solve the pitfalls Maven brought to me

Preface

The thing is simple, just as a record for the brothers behind it. I had the problem of using Maven packaging on Linux on the weekend. If you ignore the problem of the investigation, you can directly view itsolve

question

The goal you specified requires a project to execute but there is no POM in this directory (/data/my). Please verify you invoked Maven from the correct directory

  • This error refers to the current directory where there is no pom file. You must go to the location where there is a pom file in your project and execute the Maven command. For example: mvn clean -X
  • Here -X is a specific error in Dubbo debugging, and you can also use -e

spring-boot-starter-parent-2.2. and ‘’ points at wrong local POM @ line 30, column 13

Then the prompt:ModelParseExceptionException, then provide [Help 1]

/confluence/display/MAVEN/ProjectBuildingExceptionWhen you go inside, you will see that there is a problem with Parent's parent class dependency.

However, the parent dependency of the author's parent module is spring boot

<parent>
        <groupId></groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.</version>
</parent>

Here, Spring considered that if the current project needs to rely on other projects and is imported from the above-mentioned level, it can be replaced by

&lt;dependencies&gt;
            &lt;!-- SpringBootDependency configuration --&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;&lt;/groupId&gt;
                &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
                &lt;version&gt;2.2.&lt;/version&gt;
                &lt;type&gt;pom&lt;/type&gt;
                &lt;scope&gt;import&lt;/scope&gt;
            &lt;/dependency&gt;
&lt;/dependencies&gt;

This has the same effect as the parent above.

Specific website address

As a side note, this is a question of creating pom file specifications.

Because this pom file uses parent-injected spring jar package, so it leads to? ? ? The author is very confused, why?

Because this project runs normally on my IDEA, it is impossible to say that it will hang up if it is put on Linux.mvn cleanAll reported an error. Two specific errors

  • The first

spring-boot-starter-parent-2.2. and ‘’ points at wrong local POM @ line 30, column 13

  • The second one

: Unexpected error: : the trustAnchors parameter must be non-empty -> [Help 2]

According to normal people's thinking, I must solve the first one and then solve the second one, right?

But what? It took me nearly 4 hours.

  1. Is there any problem with the setting file of maven, Alibaba Cloud's image, pom dependency?
  2. Delete parent and pull again, but it still doesn't work
  3. Is jdk and maven not a match? After comparison, it matches it
  4. I re-opened my own project, but it turned out to be a big hit

So you need to have a way to solve problems. Normally, you should be the first one and then the second one.EnglishVery important.

looksecurityAn obvious permission problem, once you check it, you will find that it isHTTPSAre messing around.

I have read an article about security issues and there are several solutions, but the author chose a quick and effective one.

Ignore SSL security checks directly and load mvn package.

mvn package -=true -=true -=true

After that, run and OK is completed.

solve

Bypassing the previous lot of ideas, see if the error problem exists, and first make sure that you maven pull the jar package permission.

Just add ignoring SSL security checks to the maven command

mvn package -=true -=true -=true

Summarize

The problem of troubleshooting is very important, and some commonly used commands of maven are not learned much. I've been a little lazy lately.

The above is personal experience. I hope you can give you a reference and I hope you can support me more.