<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Maven on Salman's Blog</title><link>https://salmanfs.ca/tags/maven/</link><description>Recent content in Maven on Salman's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 01 Sep 2018 02:49:43 +0000</lastBuildDate><atom:link href="https://salmanfs.ca/tags/maven/index.xml" rel="self" type="application/rss+xml"/><item><title>Maven HelloWorld - Create, Compile and Execute a Java Maven Project</title><link>https://salmanfs.ca/posts/maven-helloworld-create-compile-and-execute-a-java-maven-project/</link><pubDate>Sat, 01 Sep 2018 02:49:43 +0000</pubDate><guid>https://salmanfs.ca/posts/maven-helloworld-create-compile-and-execute-a-java-maven-project/</guid><description>&lt;h3 id="create"&gt;Create&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mvn archetype:generate
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will start an interactive process for generating the new project. There will be prompts for the groupId, artifactId, and version (among other things).&lt;/p&gt;
&lt;p&gt;To skip the interactive method, use the following syntax instead:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mvn archetype:generate -DgroupId&lt;span style="color:#f92672"&gt;=&lt;/span&gt;ca.salmanfs.javaPractice -DartifactId&lt;span style="color:#f92672"&gt;=&lt;/span&gt;HelloWorld -DinteractiveMode&lt;span style="color:#f92672"&gt;=&lt;/span&gt;false
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="compile"&gt;Compile&lt;/h3&gt;
&lt;p&gt;Maven built us a basic Java file that prints &amp;ldquo;Hello World!&amp;rdquo;
We can compile that now:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;mvn compile
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will execute the Maven build lifecycle phases of &amp;lsquo;validate&amp;rsquo; and &amp;lsquo;compile&amp;rsquo;.
This is what Maven is doing for us:&lt;/p&gt;</description></item></channel></rss>