metaschema-framework / oscal-server

Other
3 stars 2 forks source link

Document `mvn` command for running local test server wrong #10

Closed aj-stein-gsa closed 1 month ago

aj-stein-gsa commented 1 month ago

Describe the bug

I was unable to wrong the mvn clean compile exec:java command after running mvn clean install or other analogous commands without encountering an error.

Who is the bug affecting

Running a local developer instance of the compiled server from dev.

How do we replicate this issue

See command steps below:

me@computer oscal-server % git fetch metaschema-framework                
me@computer oscal-server % git checkout --track metaschema-framework/main
branch 'main' set up to track 'metaschema-framework/main'.
Switched to a new branch 'main'
me@computer oscal-server % git rev-parse HEAD
7c6b7c8e4bee9df923c5a80e960485f450839b8a
me@computer oscal-server % mvn clean compile exec:java                                                          
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for gov.nist.secauto.oscal.tools:server:jar:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-shade-plugin @ line 262, column 15
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-assembly-plugin @ line 399, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 308, column 15
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ----------------< gov.nist.secauto.oscal.tools:server >-----------------
[INFO] Building server 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ server ---
[INFO] Deleting /Users/alexanderjstein/Code/oscal-server/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ server ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- kotlin-maven-plugin:1.7.21:compile (compile) @ server ---
[INFO] Applied plugin: 'all-open'
[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ server ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.970 s
[INFO] Finished at: 2024-10-07T18:08:14-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project server: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java are missing or invalid -> [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/PluginParameterException

Expected behavior (i.e. solution)

Local service runs after successfully compiling.

Other comments

No response

aj-stein-gsa commented 1 month ago

Sigh, disregard, something has fixed it since release in develop:

% git checkout --track metaschema-framework/develop
% git rev-parse HEAD
7c8f72422205f3c529c80b97f1c4b86cc26bd3a2
% mvn clean compile exec:java
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< gov.nist.secauto.oscal.tools:server >-----------------
[INFO] Building server 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ server ---
[INFO] Deleting /Users/alexanderjstein/Code/oscal-server/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ server ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ server ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- kotlin-maven-plugin:1.7.21:compile (compile) @ server ---
[INFO] 
[INFO] --- exec-maven-plugin:3.0.0:java (default-cli) @ server ---
2024-10-07T22:12:38.900219Z io.vertx.core.Launcher.main() ERROR Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...