xml 修改和更新教程,描述如何使用Maven插件进行Apache UIMA PEAR打包。这是完整版

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml 修改和更新教程,描述如何使用Maven插件进行Apache UIMA PEAR打包。这是完整版相关的知识,希望对你有一定的参考价值。

<!-- Adapted from: http://www.annolab.org/pearpackaging.html -->
<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/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mariodiana.uima.pear</groupId>
    <artifactId>uima-pears</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>PEAR template POM</name>
    <url>http://www.mariodiana.com</url>
    <dependencies>
        <dependency>
            <groupId>org.apache.uima</groupId>
            <artifactId>uimaj-core</artifactId>
            <version>2.8.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Copy the dependencies to the lib folder for the PEAR to copy. -->
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <stripVersion>true</stripVersion>
                            <outputDirectory>${basedir}/lib</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                            <includeScope>runtime</includeScope>
                            <!-- An exception happens when using a PEAR if the archive includes this jar. -->
                            <excludeArtifactIds>uimaj-core</excludeArtifactIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <!-- Copy descriptor files to the desc folder for the PEAR to copy. -->
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/desc</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources/desc</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <!-- Clean the libraries after packaging -->
                    <execution>
                        <id>CleanLib</id>
                        <phase>clean</phase>
                        <configuration>
                            <tasks>
                                <delete dir="lib" deleteOnExit="true" quiet="true" failOnError="false">
                                    <fileset dir="lib" includes="*.jar"/>
                                </delete>
                                <delete dir="desc" deleteOnExit="true" quiet="true" failOnError="false">
                                    <fileset dir="desc" includes="*" />
                                </delete>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

以上是关于xml 修改和更新教程,描述如何使用Maven插件进行Apache UIMA PEAR打包。这是完整版的主要内容,如果未能解决你的问题,请参考以下文章

在 pom.xml 中使用 Apache CXF Codegen 插件时出错。尝试更新 maven 时执行标记中出错。如何解决这个问题?

maven-jetty插件配置时,webdefault.xml的取得和修改

Maven教程3(依赖管理)

修改Maven本地资源库位置

Maven 发布插件 git 凭据

如何在 maven pom.xml 中正确定义插件版本?