Maven折騰日誌

10 向本地倉庫添加JAR包,如添加Oracle:java

mvn install:install-file -Dfile=ojdbc14-10.2.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2 -Dpackaging=jar

11 maven拷貝依賴包到制定目錄apache

mvn dependency:copy-dependencies -DoutputDirectory=./target/lib

12 maven制定JDK版本mybatis

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.7</source>
        <target>1.7</target>
    </configuration>
</plugin>

13 maven制定處處可執行jaroracle

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.4</version>
    <configuration>
        <archive>
        <manifest>
            <addClasspath>true</addClasspath>
            <classpathPrefix>lib/</classpathPrefix>
            <mainClass>com.chinaums.otaserver.worker.EchoWorkerServer</mainClass>
        </manifest>
        </archive>
    </configuration>
</plugin>

14 打包文件包行mybatis的xmlmaven

</resources>
    <resource>
        <directory>src/main/java</directory>
        <includes>
        <include>**/*.properties</include>
        <include>**/*.xml</include>
        </includes>
        <!-- 是否替換資源中的屬性 -->
        <filtering>false</filtering>
    </resource>

    <resource>
        <directory>src/main/resources</directory>
    </resource>
</resources>
相關文章
相關標籤/搜索