maven部署

1.在tomcat-users.xml文件的<Users>标签中添加用户角色,名称和密码

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="123456" roles="manager-gui,manager-script" />

2.在maven的setting.xml文件的<servers>标签中添加

<server>
    <id>tomcat7</id>
    <username>admin</username>
   <password>123456</password>
</server>

3.在pom.xml配置tomcat7-maven-plugin插件

<!--自动部署到tomcat-->
<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
        <server>tomcat7</server>
        <username>admin</username>
        <password>123456</password>
        <path>/qicaiyun</path>
    </configuration>
</plugin>
  1. 启动tomcat
  2. 部署相关命令
mvn tomcat7:deploy #部署
mvn tomcat7:undeploy #移除部署
mvn tomcat7:redeploy #重新部署

maven本地安装jar
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file
-Dfile=/home/li/Documents/qicaiyun-base-1.0-20180710.075517-15.jar
-DgroupId=com.qicaiyun.ai -DartifactId=qicaiyun-base
-Dversion=1.0-SNAPSHOT -DgeneratePom=true
-DlocalRepositoryPath=/home/li/.m2/repository

maven 忽略ssl
方案一: 在命令行后面的添加

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

方案二 简单粗暴好使
在setting文件中使用非https的仓库

<mirror>
        <id>central-no-ssl</id>
        <name>Central without ssl</name>
        <url>http://repo.maven.apache.org/maven2</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,347评论 19 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,053评论 6 342
  • 我jdk版本是1.7.0_95,在网上查了一下1.7属于java7maven3.3+版本都支持java7,所以我使...
    liangxifeng833阅读 5,036评论 0 2
  • 一说到兔子,那些女孩肯定会想:多么可爱,多么温顺。可是,小兔子不都这样。森林里还有一只小坏兔。 这是一只骄傲、爱骂...
    Terry的文字世界阅读 4,511评论 4 1
  • 今天早上5点32分,继续打开Will老师的公众号阅读。翻到2013.5.17第32期,用时10分钟。读到第56期,...
    石三英语阅读 1,501评论 0 0