nexus私服的maven settings.xml和pom.xml

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository>${user.home}/.m2/repository</localRepository>
  <pluginGroups>
  </pluginGroups>
  <proxies>
  </proxies>
  <servers> 
    <server>
        <id>nexus</id>
        <username>username</username>
        <password>password</password>
    </server>
  </servers>
  <mirrors>
     <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://ip:port/nexus/content/groups/public/</url>
    </mirror>
  </mirrors>
             
  <profiles>
  </profiles>
  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

pom.xml

<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>groupId</groupId>
  <artifactId>artifactId</artifactId>
  <packaging>war</packaging>
  <version>1.0.0-SNAPSHOT</version>
  <name>name</name>
  <url>http://maven.apache.org</url>
     
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <org.springframework.version>3.1.2.RELEASE</org.springframework.version>
  </properties>
       
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
     
  <distributionManagement>
        <repository>
            <id>nexus</id>
            <url>http://ip:port/nexus/content/repositories/snapshots/</url>
        </repository>
  </distributionManagement>
       
  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
                    <warName>health</warName>
                    <webResources>
                        <resource>
                            <directory>${basedir}/src/main/java</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF/classes</targetPath>
                        </resource>
                        <resource>
                            <directory>${basedir}/src/main/resources</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF/classes</targetPath>
                        </resource>
                    </webResources>
                </configuration>
        </plugin>
    </plugins>
  </build>
</project>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章