![]() ![]() ![]() Since compile and package are part of the same lifecycle, running mvn package will execute all lifecycle steps upto package, which includes the compile step We can combine these two commands by running mvn package. We can perform compilation and packaging by running the following command: mvn compile If we have multiple classes and folder (which we most likely will), we have to package the compiled code into a common format (like a. Compiling and Packaging Our JAR File #īefore running a Java application in production, we’ll need to compile the Java code into byte-code that can be run on the JVM. This generates a new project folder with the following structure: mvn-exampleĪpp.java contains simple code that prints Hello World! when run. I’ve used a groupID corresponding to my domain (), you should replace this with your own choice Mvn -B archetype:generate -DgroupId =com.sohamkamani -DartifactId =mvn-example -DarchetypeArtifactId =maven-archetype-quickstart -DarchetypeVersion =1.4 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |