2

I created a customized spring-boot starter project and want to deploy it to a remote maven repo. When I run mvn clean package deploy, I got an error said:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:repackage (repackage) on project jcr-service-spring-boot-starter: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:repackage failed: Unable to find main class -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

In fact, I don't think it is necessary for a spring-boot starter project to have got a main class, because it will never be run alone.

Could everyone help to explain how I can package the project please?

Tonny Tc
  • 852
  • 1
  • 12
  • 37

1 Answers1

0

The error message mentions the usage of the Spring Boot Maven Plugin. The official documentation mentions:

The Spring Boot Maven Plugin provides Spring Boot support in Apache Maven. It allows you to package executable jar or war archives, run Spring Boot applications, generate build information and start your Spring Boot application prior to running integration tests.

Since you goal is to create a custom Spring Boot starter, there's no need to use the spring-boot-maven-plugin, so just remove it from your pom.xml and you should be able to package and deploy your jar.

Rolando Isidoro
  • 4,983
  • 2
  • 31
  • 43