我刚开始使用Maven,并且阅读了插件是可以使用的其他组件。文件 的典型结构pom.xml是
pom.xml
<project> <groupId>org.koshik.javabrains</groupId> <artifactId>JarName</artifactId> (A fldernamed JarName was created) <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>JarName</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>
问题 :我应该在哪里插入plugin标签?例如以下内容:
plugin
<plugin> <groupId>org.jibx</groupId> <artifactId>jibx-maven-plugin</artifactId> <version>1.2.4</version> <executions> <execution> <goals> <goal>bind</goal> </goals> </execution> </executions> </plugin>
在依赖之前还是在dependency标签之后?有关系吗?
dependency
<project> <groupId>org.koshik.javabrains</groupId> <artifactId>JarName</artifactId> (A fldernamed JarName was created) <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>JarName</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <build> <plugins> <plugin> <groupId>org.jibx</groupId> <artifactId>jibx-maven-plugin</artifactId> <version>1.2.4</version> <executions> <execution> <goals> <goal>bind</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>
如果使用Maven配置文件,也可以将插件放置在的<build>部分中<profile>。顺序无关紧要。
<build>
<profile>