springboot-keycloak-openldap icon indicating copy to clipboard operation
springboot-keycloak-openldap copied to clipboard

Run simple-service using Maven returns error

Open BoProc opened this issue 1 year ago • 3 comments

Starting the application with ./mvnw clean spring-boot:run --projects simple-service -Dspring-boot.run.jvmArguments="-Dserver.port=9080"

downloads the dependencies but ends with the following error:

[ERROR] Unknown lifecycle phase ".run.jvmArguments=-Dserver.port=9080". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]

It seems like maven doesn't understand the specified goals/lifecycle phase clean or run? I also tried this with my local maven, bit it produced the same result. I have

openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

installed. Do you have an idea what the issue could be? Maybe something in the formatting is not right?

PS: I am executing this on windows in powershell

BoProc avatar Nov 07 '23 16:11 BoProc

Hi @BoProc

I do not know as I am Mac user.

One alternative is to set the server.port, in the application.properties file,

server.port=9080

Then you run

mvnw.cmd clean spring-boot:run --projects simple-service

According to Maven Wrapper documentation, on Windows, we need to use mvnw.cmd

ivangfr avatar Nov 07 '23 17:11 ivangfr

Thanks for the reply :-) Both suggestions worked, although i had to prefix ./

./mvnw.cmd clean spring-boot:run --projects simple-service

Maybe it is worth uploading the image to dockerhub? This would also make it easier to spin up different containers with different configurations.

BoProc avatar Nov 08 '23 14:11 BoProc

That is nice, it has worked on your side.

About building and uploading a Docker image of simple-service app, I believe there won't be many users interested in it.

ivangfr avatar Nov 08 '23 21:11 ivangfr