Adding a class pool to the SpringBoot command line starts when using maven-spring-boot-plugin

I am trying to add a class path when I launch my spring boot application that starts with the following command

mvn spring-boot:run

I can currently add the classpath folder to my maven tests using custom arguments inserted in the field

However, this approach did not work to run the application with mvn spring-boot: run

+1
source share
2 answers

Spring Boot Maven Plugin spawns a JVM, which by default will include everything your project says should be in the class path, for example

  • ${project.build.outputDirectory} includes classes and resources
  • , POM

, :

, : /this/that/theother , spring -boot :

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <folders>
            <folder>
                /this/that/theother
            </folder>
        </folders>
    </configuration>
</plugin>

, mvn spring-boot:run -X, , ...

[DEBUG] path for forked process:/this/that/theother:...

+3

pom https://docs.spring.io/spring-boot/docs/current/maven-plugin/run-mojo.html, ,

mvn -Dspring-boot.run.folders=/etc/bbcom spring-boot:run
0

Source: https://habr.com/ru/post/1665732/


All Articles