11.1 Creating the POM(创建POM文件)
1 | We need to start by creating a Maven pom.xml file. The pom.xml is |
我们需要以创建一个pom.xml文件开始。pom.xml是用于构建项目的配方。 打开您最喜欢的文本编辑器并添加以下内容:
1 | <?xml version="1.0" encoding="UTF-8"?> |
1 | The preceding listing should give you a working build. You can |
上面的列表应该已经给了您一个可工作的构建。您可以使用mvn package来运行测试它(现在,你可以忽略“jar will be empty - no content was marked for inclusion!“的警告)1
2
3At this point, you could import the project into an IDE (most
modern Java IDEs include built-in support for Maven). For simplicity,
we continue to use a plain text editor for this example.
在此刻,您可以导入该工程到IDE(所有的流行的javaIDE都支持导入Maven项目)。为了简化,我们继续使用纯文本编辑器编辑示例。