Home > Back-end >  Maven Packaging
Maven Packaging

Time:08-02

I have a spring boot app version 2.7.0 and java version 17.

I have made a shared dependency and push to local maven dependency jfrog.

Then I have included this dependency to my app

<dependency>
    <groupId>com.microservice</groupId>
    <artifactId>utils-starter</artifactId>
    <version>1.0.0</version>
</dependency>

Whenver I run mvn clean package I get

Package does not exits

It seems mvn does not see the package but IntelliJ Idea does.

But when I run with Intellij Idea, it runs well but mvn package fails

Can someone help?

CodePudding user response:

Found problem.

The package (utils-starter) I created had this plugin

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

So removing it solved the problem

CodePudding user response:

Since you are running a local artefact manager, you tell Maven need where to find it. You can configure it in your POM. (There are also other ways, see the link provided below)

To configure it in your POM, it should look something like this:

<project>
  ...
  <repositories>
    <repository>
      <id>my-repo</id>
      <name>My Repository</name>
      <url>file://path/to/our/local/repository</url>
    </repository>
  </repositories>
</project>

You can find a more in-depth tutorial here:

https://howtodoinjava.com/maven/change-local-repository-location/

  • Related