To create Java project framework with Maven.
1.
Download maven plugin for Eclipse from the
Eclipse Market place.
2. Configure environmental variables of your
machine according to system path of maven.
3. Now create a maven project in Eclipse. Click on File
à New --> Maven
Project.
4. Now select the check box “Create a simple
Project” and click next.
5. Click on Next button. Enter Group Id, Artifact Id. In general, the Group Id should correspond to
your organization name, and the Artifact Id
should correspond to the project’s name.
If this is a stand-alone project that does not have parent
dependencies, you may leave the Parent Project
section as is. Fill out the appropriate information, and click Finish.
6.
Project structure is created as shown below.
Here in the
1)
src/main/java – Write your java code.
2)
src/main/resources – Place your resource file in
this folder.
3)
src/test/java – Place your test code in this
folder.
4)
src/main/resources – Place your test resources
in this folder.
5)
Pom.xml -- Open the pom.xml file to view the
structure Maven has set up. You may also use the tabs at the bottom of the
window to change to view Dependencies,
the Dependency Hierarchy, the Effective POM, and the raw xml
code for the pom file in the pom.xml tab.
You now have a new Java project with Maven enabled.
No comments:
Post a Comment