Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown lifecycle phase "/home/containeruser/.m2" when run './mvnw clean package -P postgres' #457

Closed
c2j opened this issue Feb 3, 2024 · 3 comments · Fixed by #462
Closed
Assignees

Comments

@c2j
Copy link

c2j commented Feb 3, 2024

Follow How use with Docker, Build or pull a dev image to help building from source:

./docker/benchbase/build-dev-image.sh
./docker/benchbase/run-dev-image.sh

then execute maven:

containeruser@96a38c738196:/benchbase$ ./mvnw clean package -P postgres
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< com.oltpbenchmark:benchbase >---------------------
[INFO] Building BenchBase 2023-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.044 s
[INFO] Finished at: 2024-02-03T05:33:30Z
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "/home/containeruser/.m2". 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: 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-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException

To solve the issue, just export MAVEN_CONFIG= to empty the env var MAVEN_CONFIG

@bpkroth
Copy link
Collaborator

bpkroth commented Feb 8, 2024

Thanks for reporting. Looks like our devcontainer optimization attempts for reusing the local mvn cache inside the container overlapped with the wrapper scripts environment variable expectations.

When using the dev container you should be able to just mvn instead of the local mvnw wrapper script for now.

I'll push a PR to fix this in a moment.

@bpkroth
Copy link
Collaborator

bpkroth commented Feb 8, 2024

Actually, we were just overriding the value in the upstream docker image:

docker image inspect maven:3.9.5-eclipse-temurin-21 | grep -C 8 MAVEN_CONFIG
            "Env": [
                "PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "JAVA_HOME=/opt/java/openjdk",
                "LANG=en_US.UTF-8",
                "LANGUAGE=en_US:en",
                "LC_ALL=en_US.UTF-8",
                "JAVA_VERSION=jdk-21.0.1+12",
                "MAVEN_HOME=/usr/share/maven",
                "MAVEN_CONFIG=/root/.m2"
            ],
            "Cmd": [
                "mvn"
            ],
            "ArgsEscaped": true,
            "Image": "",
            "Volumes": null,
            "WorkingDir": "",

@bpkroth
Copy link
Collaborator

bpkroth commented Feb 8, 2024

If you could please give the branch in #462 a shot to confirm, I think that should fix things.

BTW, you can also launch the devcontainer in vscode instead of the first two commands you have listed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants