0

I got myself up and running with Spring, maven using Spring Boot. You may check the below link for details -

https://ashikuzzaman.wordpress.com/2015/06/04/spring-with-maven-using-spring-boot/

In my pom.xml I have the following properties defined.

<properties>
    <java.version>1.7</java.version>
    <!-- The main class to start by executing java -jar -->
    <start-class>com.github.ashikuzzaman.javaapichecks.spring.RawLinkedListTypes</start-class>
</properties>

I wanted to pass one or more runtime arguements to get into the arguement list that main() accepts. Can I do this via a parameter passing in start-class or main-class?

  • You may see the link - http://stackoverflow.com/questions/3545292/how-to-get-maven-project-version-to-the-bash-command-line – Razib Jun 09 '15 at 18:46

1 Answers1

0

Suppose you are trying to give some value for java.version while you are using mvn package command from terminal. Then you can use it -

mvn package "-Djava.version=1.7"
Razib
  • 10,965
  • 11
  • 53
  • 80
  • I think the question regards passing data to the `main` function, which this doesn't appear to address directly. – Dave Newton Jun 09 '15 at 18:53
  • Yes, I was talking about passing data like we pass in array of arguements to main method. For example, I want to say java com.mypackage.MyTestProgram sort 5 8 9 1 – Ashik Uzzaman Jun 10 '15 at 19:31