楼主: ReneeBK
1200 7

Apache Maven 3 Cookbook [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4900份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49655 个
通用积分
55.9937
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2017-5-7 10:28:31 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

  1. Author:Srirangan
  2. ISBN-10:1849512442
  3. Year:2011
  4. Pages:224
  5. Language:English
  6. File size:4.89 MB
  7. File format:PDF
  8. Category:Programming
复制代码

本帖隐藏的内容

Apache Maven 3 Cookbook.pdf (4.81 MB)



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝


沙发
stormchao 在职认证  发表于 2017-5-7 19:27:56
不错的好书。

藤椅
Lisrelchen 发表于 2017-5-13 23:50:56

Importing an existing Maven project in Eclipse


If you have already set up a Maven project from the command-line, then it can easily be imported to Eclipse.

If you have not yet set up Eclipse and verified that Maven exists, please follow the Getting ready section of the preceding recipe.

How to do it...


To import an existing Maven project in Eclipse, perform the following steps:

  • Navigate to File | Import… and click on Maven:
  • Choose the project we created in the previous chapter:
  • Import the project. You will see contents identical to what we saw when creating a new Maven project.


How it works...


Eclipse has built-in support for Maven projects. When a Maven project is imported, it parses the pom file, pom.xml, for the specified project. Based on the project's pom configuration file, it creates relevant Eclipse configurations to recognize source files, tests, and artifacts.

It also identifies all the dependencies of the project, downloads these using Maven (if they haven't been downloaded already), and adds them to the project dependencies.


板凳
Lisrelchen 发表于 2017-5-13 23:52:34
  1. Creating a new Maven project in NetBeans

  2. NetBeans is another popular IDE. This is backed by Oracle, is equally feature-rich and extensible, and supports multiple languages, such as Eclipse.

  3. As of writing this, NetBeans 8.0.2 is the most recent edition. The screenshots in this book reflect this version.

  4. Getting ready

  5. NetBeans can be downloaded in two different ways (if not downloaded already):

  6. Oracle provides a download of the latest JDK along with the latest version of NetBeans. This is a good option, especially if you have not installed JDK yet.
  7. If JDK is already installed, then NetBeans can be downloaded separately from https://netbeans.org/. There are different bundles of NetBeans (similar to Eclipse). You can choose one from Java SE or Java EE, or all of them, based on your preference.
  8. How to do it...

  9. Now that NetBeans is installed, let us create a new Maven project, by performing the following steps:

  10. Navigate to Tools | Options. Choose Java and click on the Maven tab. You will notice Maven Home showing up as Bundled with (Version: 3.0.5):
  11. How to do it...
  12. You can leave it as is or change it to your Maven installation by choosing the dropdown.
  13. Now navigate to File | New Project.
  14. Choose Maven from Categories: and Java Application from Projects:, as shown in the following screenshot:

  15. Specify the details of the project:

  16. You are done! A new project is now created in NetBeans.

  17. How it works...

  18. Like Eclipse, NetBeans has built-in support for Maven. Unlike Eclipse, NetBeans did not use the Maven archetype for a quick start. Instead, it created a new project using its template. In this case, you will notice that it did not create the dummy source and test class that the quick archetype creates.
复制代码

报纸
Lisrelchen 发表于 2017-5-13 23:53:09
  1. Creating a new Maven project in IntelliJ IDEA

  2. IntelliJ IDEA is an IDE from JetBrains. It has both Community and commercial editions. IntelliJ IDEA is enormously popular among developers and is regularly updated with the latest language and platform features.

  3. For the purpose of this cookbook, we will use the Community Edition. The steps are the same for the commercial edition as well.

  4. As of writing this book, IntelliJ IDEA 14.0.3 is the most recent edition. The screenshots in this book reflect this version.

  5. Getting ready

  6. As IntelliJ IDEA needs a Java environment to run, let us first ensure that the Java environment is set up on our system:

  7. Ensure that JDK is installed.
  8. Download IntelliJ IDEA by visiting https://www.jetbrains.com/idea/ and clicking on the Download link.
  9. Ensure the project SDK is set to your Java installation.
  10. How to do it...

  11. Use the following steps to create a new Maven project in IntelliJ IDEA:

  12. Open IntelliJ IDEA.
  13. Click on Create New Project.
  14. Choose Maven.
  15. Select the Create from archetype option and choose maven-archetype-quickstart:1.1:
  16. How to do it...
  17. Specify the values required to create the project:

  18. Confirm the values for the project:

  19. You are done! A new Maven project is created in IntelliJ IDEA.

  20. How it works...

  21. IntelliJ IDEA has first-class support for Maven. It can create a new Maven project as per archetype by downloading the required plugins and dependencies from the repository. It uses the configured Maven settings, which can be customized as specified in the next section.
复制代码

地板
Lisrelchen 发表于 2017-5-13 23:55:11
  1. Understanding the Maven lifecycle, phases, and goals

  2. As we start using Maven, we need to understand the Maven project lifecycle. Maven is implemented based around the concept of a build lifecycle. This means there is a clearly defined process to build and distribute artifacts with Maven.

  3. What makes up a lifecycle? The stages of a lifecycle are called phases. In each phase, one or more goals can be executed.

  4. Getting ready

  5. Maven is set up on your system and is verified as working. For setting up Apache Maven, refer to the first three recipes of Chapter 1, Getting Started.

  6. How to do it...

  7. To build a Maven project, perform the following steps:

  8. Open the command prompt.
  9. Run one of the Maven commands that we are familiar with:
  10. mvn package
  11. Observe the various steps that get executed.
复制代码

7
Lisrelchen 发表于 2017-5-13 23:55:48
  1. Understanding the pom file

  2. Every Maven project has a pom file that defines what the project is all about and how it should be built. Pom is an acronym for project object model. Let us take a peek at this file.

  3. How to do it...

  4. Let's understand the pom file, by performing the following steps:

  5. Go to a Maven project that we created in previous chapters.
  6. Open the file named pom.xml.
复制代码

8
Lisrelchen 发表于 2017-5-13 23:57:47
  1. Understanding Maven settings

  2. Now that we have got an idea of the essential elements of a pom file, let us also examine the various setting properties of Maven.

  3. How to do it...

  4. To understand the Maven settings, perform the following steps:

  5. Open the settings.xml file in the .m2 subfolder of your HOME folder, if it exists:

  6. Otherwise, open the settings.xml file in the conf folder of your Maven installation (as defined in M2_HOME).
复制代码


您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-22 17:02