maven deploy

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>E:\maven_repository</localRepository>

  <pluginGroups>

  </pluginGroups>

  <proxies>

  </proxies>

 <!-- 设置发布时的用户名 -->
 <servers>
     <server>
         <id> releases </id>
        <username>admin</username>
        <password>admin123</password>
    </server>
    <server>
        <id> snapshots </id>
        <username>admin</username>
        <password>admin123</password>
 </server>
 </servers>

 <mirrors>
     <mirror>
         <!--此处配置所有的构建均从私有仓库中下载 *代表所有,也可以写central -->
         <id>nexus</id>
         <mirrorOf>*</mirrorOf>
         <url>http://localhost:8081/nexus/content/groups/public</url>
     </mirror>
 </mirrors>

<profiles>
     <profile>
         <id>nexus</id>
         <!-- 所有请求均通过镜像 -->
         <repositories>
             <repository>
                 <id>central</id>
                 <url>http://central</url>
                 <releases><enabled>true</enabled></releases>
                  <snapshots><enabled>true</enabled></snapshots>
             </repository>
         </repositories>
         <pluginRepositories>
             <pluginRepository>
                 <id>central</id>
                 <url>http://central</url>
                 <releases><enabled>true</enabled></releases>
                 <snapshots><enabled>true</enabled></snapshots>
             </pluginRepository>
         </pluginRepositories>
     </profile>
 </profiles>

<activeProfiles>
 <!--make the profile active all the time -->
 <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>com.mzj</groupId>
    <artifactId>practice</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>practice Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>3.2.8.RELEASE</spring.version>
        <mina.version>2.0.7</mina.version>
        <netty.version>4.0.23.Final</netty.version>
        <tomcat.version>7.0.53</tomcat.version>
    </properties>

    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>Internal Releases</name>
            <url>http://localhost:8081/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Internal Snapshots</name>
            <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>

        <!--日志: -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.7</version>
        </dependency>

        <!--测试: -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>practice</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <!--deploy source -->
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--deploy javadoc -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

deploy:

在  http://localhost:8081/nexus/index.html   查看:

时间: 2024-11-17 13:24:25

maven deploy的相关文章

Maven(六) eclipse 使用Maven deploy命令部署构建到Nexus

转载于:http://blog.csdn.net/jun55xiu/article/details/43051627 1  应用场景:SYS-UTIL(系统工具)项目部署.构建成JAR包(SYS-UTIL-XXX.jar)存储到Nexus私服上,以供其它项目(依赖)使用 2 目的:通过Nexus网页服务器管理项目开发各周期中不同版本的JAR包(如SYS-UTIL-0.0.1.jar,....................SYS-UTIL-1.0.1.jar) 3 操作过程: 1) 创建SYS-

maven deploy 代码

Run As --> Run Configurations ---> Maven Build --->New _Configuration(双击Maven Build可生成) --> Browse Workspace 选中项目, Goals输入 : deploy -e 后,点击 Run 原文地址:https://www.cnblogs.com/comeluder/p/8358067.html

maven deploy jar包到远程仓库400

第一步,登陆nexus http://maven.repo.[公司域].com/nexus/#welcome 查看账号是否有上传权限,选择某个respository如果如下图所示,代表有权限 第二步,查看是否有下列问题 用户凭据错误:用户密码是否错误,在${user}/.m2/setting.xml查看url到服务器是错误的:这里不能直接用setting.xml里面的 ***/content/groups/public/, 因为这是一个仓库组,而要用具体的仓库url,类似于**/content/

Maven deploy时异常Fatal error compiling: tools.jar not found错误

1 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project com.dallas.pay: Fatal error compiling: tools.jar not found: D:\Java\jre7\..\lib\tools.jar -> [Help 1] 上面就是报错信息:意思是在D:\Java\jre7\..\lib\

maven deploy jar

mvn:deploy在整合或者发布环境下执行,将最终版本的包拷贝到远程的repository,使得其他的开发者或者工程可以共享. 以将ojdbc14传到nexus中的thirdparty为例 一 配置settings.xml 因为nexus是需要登陆操作,当然可以通过配置免登陆,这是后话. 在settings.xml的<servers></servers> <server>   <id>thirdparty</id>   <username

Maven deploy时报Fatal error compiling: tools.jar not found错误的问题处理

在Eclipse环境下,使用Maven进行Maven Intall 时发现报了该错误:Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre6\..\lib\tools.jar. 解决办法: 点击Eclipse菜单:Window->Preferences->Java->Installed JREs,选择右侧的Edit来修改JREs,之前我的JAVA_HOME设置的是:D:\Program Files\Ja

maven deploy 上传jar包到私有仓库

mvn deploy:deploy-file -DgroupId=com.weibo.datasys -DartifactId=data-flow -Dversion=2.0.0 -Dpackaging=jar -Dfile=./target/data-flow-2.0.0-SNAPSHOT.jar -DgeneratePom=true -Durl=http://***/nexus/content/repositories/releases -DrepositoryId=*** 原文地址:htt

maven deploy到ftp服务器

参考文章 Maven自动FTP远程部署 - 万里沙来手一挥 - 博客园 ------------------------------------------------------------------ 1.按照上述文章配置pom.xml和maven的setting.xml. 2.开启vsftp的被动模式,并设置被动模式的最小最大端口范围,以便于在防火墙中开启. pasv_enable=YES(默认为YES) pasv_min_port=1024(default:0(use any port)

Maven deploy时排除指定的某个module

在某个module的pom.xml中添加如下配置 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> <configuration> <skip>true</skip> </configur