Note that there are some explanatory texts on larger screens.

plurals
  1. POBeginner Steps to Configure a Java Project to Build with Apache Maven
    primarykey
    data
    text
    <p>I've been given the task of migrating an existing project -- formerly built with Ant -- to use Apache Maven. I'm brand new to the entire concept, though I've spent the last several hours doing as much research as I can on the subject. Sadly, I'm having some proxy issues when it comes to installing things like m2e and Eclipse IAM, so everything must be done from the command prompt. As of right now, I do have maven installed properly; the trick now is to use it in my project rather than Ant. I've looked online and found a few tutorials, but they are all too vague for me considering my lack of experience with all of this. If anyone can break the steps down for me one-by-one in a detailed manner, that would be more than amazing. On a side note, I've been told to add the following to the local Maven Settings:</p> <pre><code>&lt;settings&gt; &lt;servers&gt; &lt;server&gt; &lt;id&gt;local_tomcat&lt;/id&gt; &lt;username&gt;admin&lt;/username&gt; &lt;password&gt;tomcat&lt;/password&gt; &lt;/server&gt; &lt;server&gt; &lt;id&gt;artifactory&lt;/id&gt; &lt;username&gt;user&lt;/username&gt; &lt;password&gt;password&lt;/password&gt; &lt;/server&gt; &lt;/servers&gt; &lt;mirrors&gt; &lt;mirror&gt; &lt;id&gt;artifactory&lt;/id&gt; &lt;name&gt;Artifactory&lt;/name&gt; &lt;url&gt;https://jenkins.web.jw.local/artifactory/repo1&lt;/url&gt; &lt;mirrorOf&gt;central&lt;/mirrorOf&gt; &lt;/mirror&gt; &lt;/mirrors&gt; &lt;proxies&gt; &lt;proxy&gt; &lt;active&gt;true&lt;/active&gt; &lt;protocol&gt;http&lt;/protocol&gt; &lt;host&gt;proxy.jw.local&lt;/host&gt; &lt;port&gt;80&lt;/port&gt; &lt;username&gt;user&lt;/username&gt; &lt;password&gt;password&lt;/password&gt; &lt;nonProxyHosts&gt;*.jw.local&lt;/nonProxyHosts&gt; &lt;/proxy&gt; &lt;/proxies&gt; &lt;/settings&gt; </code></pre> <p>With the obvious username and password information filled in. I think I've managed that thus far by simply adding the necessary blocks into the settings.xml file under my ApacheMaven\conf directory. Other than that single step, I'm pretty much lost. Again, any help, especially that of a detailed tutorial in terms of command line instructions to build this project would be wonderful. Oh, and on another side-note, I am using Eclipse... Not sure if that would matter much.</p> <p><strong>EDIT</strong>: Considering Petr Kozelka's answer, I've attempted to make a pom.xml file for my project. Here's what I have so far...</p> <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.company&lt;/groupId&gt; &lt;artifactId&gt;appName&lt;/artifactId&gt; &lt;version&gt;1.0.0&lt;/version&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;name&gt;Application Name&lt;/name&gt; &lt;description&gt;Yadda Yadda&lt;/description&gt; &lt;build&gt; &lt;plugins&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;dependencies&gt; &lt;/dependencies&gt; &lt;repositories&gt; &lt;/repositories&gt; &lt;/project&gt; </code></pre> <p>Is this heading in the right direction? Also, do I need to construct the archetype.xml file myself, or will Maven do that through the command line somehow? If I need to do it myself, this is what I've come up with thus far:</p> <pre><code>&lt;archetype xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0 http://maven.apache.org/xsd/archetype-1.0.0.xsd"&gt; &lt;id&gt;lighthouse&lt;/id&gt; &lt;sources&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/AddTimeController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/BugController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/DeleteTimeController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/EnterTimeController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/ModifyTimeController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/PersonController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/ProjectController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/controller/TimeController.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/Area.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/Bug.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/DBModel.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/DefaultModel.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/JWModel.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/JWTime.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/Person.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/model/Project.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/util/Lighthouse.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/util/LighthouseApplicationListener.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/util/LighthouseServlet.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/util/LighthouseSystemProperties.java&lt;/source&gt; &lt;source&gt;src/com/jeldwen/lighthouse/LighthouseApp.java&lt;/source&gt; &lt;/sources&gt; &lt;testSources&gt; &lt;!-- None --&gt; &lt;/testSources&gt; &lt;allowPartial&gt;true&lt;/allowPartial&gt; &lt;/archetype&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload