Using Maven for Java program invocation

2019-11-08T23:24:34

Background
I am a Maven newbie and I greatly like the fact that Maven knows where to pick up all the JAR files needed for executing a Java program (i.e. the fact that the required JARs need not be specified in the CLASSPATH environment variable since they are all stored in the .m2 repository).

I thought Maven could be the preferred way to invoke Java programs for real world applications but for a previous post of mine the following comment was received:
If you want to execute java programs I would suggest to create self running artifacts instead of using maven to execute a program

This brings me to the following questions:


Questions

  1. Should using Maven as the tool for invoking Java programs be frowned upon?
  2. If yes (i.e. there are issues in using Maven as the preferred method for Java program invocation), what are the better alternatives and why?

Copyright License:
Author:「Sandeep」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/58769393/using-maven-for-java-program-invocation

About “Using Maven for Java program invocation” questions

Background I am a Maven newbie and I greatly like the fact that Maven knows where to pick up all the JAR files needed for executing a Java program (i.e. the fact that the required JARs need not be
My question is quite basic and I am a bit surprised I could not easily find an answer by googling or from maven-exec-plugin documentation. I need to execute my java program in my maven project,
I am a beginner with Java, Maven, and Eclipse. I have made a simple standalone Java program and generated a Maven package with Eclipse LUNA. When I began to debug the Java program, I found that
I'm using Maven Java API to configure Maven in a custom Java project. In particular I need to configure some Maven settings, among which there are proxy settings. How can i do this? I googled a lot...
How to run Maven deploy(which will deploy to remote nexus repository) command using java Program..
I have a problem with the following code: public class A { public String someMethod() { return "some"; } } public class AExtension { public static void extensionMethod(A a, St...
I have a Java program in IntelliJ which has a pom.xml and uses Maven. The packages were downloaded and currently they are found by IntelliJ. I'm a little confused though because the Maven reposito...
I have a spring application a new code I have inserted - fail the maven test - but only from maven when I run the test from intelliJ the test succeeded. From maven/jenkins failed org.springfram...
I'm attempting to compile javabot on windows using maven 2. I've compiled java programs in the past ( so I know the default JDK is working correctly), and this is my first time using maven. The err...
I have selenium maven project created. For running the tests I have to run one program that will create testNG.xml which contains list of test cases to be executed. But for that I need to run one J...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.