j-interop-code-148-trunk (3.0.0) Maven 打包 POM 文件

一、下载 SVN 上的源码

j-interop-code-148-trunk.zip

http://sourceforge.net/p/j-interop/code/148/tree/trunk/

二、放置三个 POM 配置文件

目录结构

--  pom.xml
 |--  j-interop
 |         |--  pom.xml
 |--  j-interopdeps
 |         |--  pom.xml

这三个 pom.xml 在 ZIP 中是不存在在,需要大家把我提供的3个 pom.xml 放在对应的目录中。

1、主 pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>


    <groupId>org.j-interop</groupId>
    <artifactId>j-interop-parent</artifactId>
<version>3.0.0-r148</version>
<packaging>pom</packaging>

    <properties>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compile.source>1.6</maven.compile.source>
        <maven.compile.target>1.6</maven.compile.target>

        <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
</properties>

   <build>

        <sourceDirectory>src</sourceDirectory>
        <resources>
            <resource>
                <directory>src</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${maven.compile.source}</source>
                    <target>${maven.compile.target}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <locale>en_US</locale>
                    <failOnError>false</failOnError>
                    <quiet>true</quiet>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

<modules>
<module>j-interop</module>
<module>j-interopdeps</module>


</modules>


 <distributionManagement>

        <repository>
            <id>central</id>
            <name>Noahx Artifactory-releases</name>
            <url>http://noahx.org/artifactory/ext-release-local</url>
        </repository>


    </distributionManagement>
</project>

注意:如果需要使用 mvn deploy 指令,请修改 central 仓库的配置到你自己的私有仓库。


2、j-interop/pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.j-interop</groupId>
		<artifactId>j-interop-parent</artifactId>
		<version>3.0.0-r148</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>j-interop</artifactId>
	<name>${project.artifactId}</name>
	<packaging>jar</packaging>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>j-interopdeps</artifactId>
			<version>${project.version}</version>
		</dependency>
	</dependencies>

</project>


3、j-interopdeps/pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.j-interop</groupId>
		<artifactId>j-interop-parent</artifactId>
		<version>3.0.0-r148</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>j-interopdeps</artifactId>
	<name>${project.artifactId}</name>
	<packaging>jar</packaging>

	<dependencies>
		<dependency>
		<groupId>org.samba.jcifs</groupId>
		<artifactId>jcifs</artifactId>
		<version>1.2.19</version>
		</dependency>
	</dependencies>

</project>


三、打包

在主 pom.xml 所在的目录执行 mvn 指令。我的 maven 版本是 Apache Maven 3.2.1。

1、打包

mvn clean package


2、打包安装(本地)

mvn clean install


3、打包部署(私有仓库)

mvn clean deploy


四、附件下载

j-Interop pom.xml 配置包:http://1drv.ms/1lBjOqm


你可能感兴趣的:(maven,jar,打包,DCOM,j-interop)