• cd /d e:work2,更改至当前工作目录
    svnup.bat,批量更新所有项目
    @echo off
    for /D %%i in (.\*) do (
    echo %%i
    svn up %%i
    )
    host.bat,本地临时更改域名解析
    notepad C:\Windows\System32\drivers\etc\hosts
    db.bat,方便连接内网数据库
    @echo off
    set db=default_db
    if ""%1"" == ""data"" goto data
    if ""%1"" == ""user"" goto user
    goto end
    :data
    set db=data_db
    goto end
    :user
    set db=user_db
    goto end
    :end
    mysql -h192.168.1.202 -uroot -p123456 -D%db%
  • mvn install
    项目管理通常使用mvn,组件类项目可以mvn install提交到本地依赖库后供其它项目引用,使用Nexus私服的配置为:${M2_HOME}/conf/settings.xml
    <mirrors><mirror>
    <id>nexus</id><name>local</name><url>http://localhost:8079/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
    </mirror></mirrors>
    如果要使用mvn deploy提交构件(而不是他人check out源码并mvn install),还需要配置:${M2_HOME}/conf/settings.xml
    <servers><server><id>nexus</id><username>admin</username><password>admin123</password></server></servers>
    以及项目配置pom.xml
    <distributionManagement>
     <repository><id>nexus</id><name>local</name><url>http://localhost:8079/nexus/content/groups/public/</url>
      </repository></distributionManagement>
  • mvn war:exploded
    网站项目通常不必打包war,发布时直接用WinSCP同步WebContent目录即可,命令mvn war:exploded可以构建完整的可直接被tomcat加载运行的WebContent目录,同时调试java和jsp都很方便。
    一种方式是直接编译输出class到WebContent/WEB-INF/classes目录(这时WEB-INF/lib会有jar包),然后用tomcat直接加载WebContent目录
    <build>
        <resources><resource><directory>src/main/resources</directory></resource></resources>
        <outputDirectory>WebContent/WEB-INF/classes</outputDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                    <webappDirectory>WebContent</webappDirectory>
                </configuration>
            </plugin>
        </plugins>

    </build>
    另一种方式是编译输出到另外的目录(class+jsp+jar等),这时需要将WebContent也加入Source并输出到目标目录以便调试jsp(使用WebContentLink链接),同时WebContent/WEB-INF/classes链接到真正目标目录${target}/WebContent/WEB-INF/classes

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.test.skip>true</maven.test.skip>
        <targets.home>E:\work2\Servers\web</targets.home>

    </properties>

    <build>
        <directory>${targets.home}/${project.artifactId}/target</directory>
        <outputDirectory>${targets.home}/${project.artifactId}/WebContent/WEB-INF/classes</outputDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                    <webappDirectory>${targets.home}/${project.artifactId}/WebContent</webappDirectory>
                </configuration>
            </plugin>
        </plugins>

    </build>
    调试运行或发布WebContent目录即可
    <Context docBase="E:\work2\Servers\web\MyWeb\WebContent" path="/MyWeb"/>

  • 线上部署
    netstat -lntp,查看端口对应的进程

    ps -ef|grep java,查看运行的java项目

    nginx/sbin/nginx,运行nginx,重启-s reload,停止-s stop,配置vi nginx/conf/nginx.conf,日志tail -f nginx/logs/access.log
    resin/bin/resin.sh start,运行resin,重启restart,停止stop,配置vi resin/conf/resin.xml,日志tail -f resin/log/jvm-app-0.log
    ifconfig,查看IP地址;
    df -hlT,查看存储;top,查看运行状态
 

java开发常用命令的更多相关文章

  1. java cmd常用命令

    熟悉Java的常用命令 面试例题11:使用jar命令. 请使用jar命令,将test文件夹压缩成.jar文件,并简述其压缩包的结构. 考点:对于Java程序员来说,更多情况下是使用集成Java开发工具 ...

  2. Java开发常用Linux命令

    1.查找文件 find / -name filename.txt根据名称查找/目录下的filename.txt文件. find . -name "*.xml"递归查找所有的xml文 ...

  3. java 开发常用的Linux命令

    1.查找文件 find / -name filename.txt 根据名称查找/目录下的filename.txt文件. find . -name "*.xml" 递归查找所有的xm ...

  4. java开发常用的Linux命令

    原文:https://www.cnblogs.com/not-alone/p/8505925.html 1.查找文件 find / -name filename.txt 根据名称查找/目录下的file ...

  5. JAVA开发常用计算机命令

    系统常用命令 win+r > control (可进入控制面板,管理工具,服务) win+r > cmd > systeminfo (x86-based 指32位系统,x86-64 ...

  6. java开发常用jar包介绍(转载)

    jta.jar 标准JTA API必要 commons-collections.jar 集合类 必要 antlr.jar  ANother Tool for Language Recognition ...

  7. Linux中Java开发常用的软件总结:

    开发工具下载: Tomcat下载:wget http://learning.happymmall.com/tomcat/apache-tomcat-7.0.73.tar.gzJDK下载: wget h ...

  8. Java开发常用的在线工具

    原文出处: hollischuang(@Hollis_Chuang) 作为一个Java开发人员,经常要和各种各样的工具打交道,除了我们常用的IDE工具以外,其实还有很多工具是我们在日常开发及学习过程中 ...

  9. [开发工具]Java开发常用的在线工具

    注明: 本文转自http://www.hollischuang.com/archives/1459.作为一个Java开发人员,经常要和各种各样的工具打交道,除了我们常用的IDE工具以外,其实还有很多工 ...

随机推荐

  1. Windows消息机制要点

    1. 窗口过程     每个窗口会有一个称为窗口过程的回调函数(WndProc),它带有四个参数,分别为:窗口句柄(Window Handle),消息ID(Message ID),和两个消息参数(wP ...

  2. GetQueuedCompletionStatus的返回值

    完成端口GetQueuedCompletionStatus返回值的问题 先看看GetQueuedCompletionStatus函数的完整声明:BOOL GetQueuedCompletionStat ...

  3. VM VirtualBox 上安装 CentOs6.4(详细)

    在网上下载:CentOS-6.4-i386-bin-DVD1.iso镜像. 这是我在VBox上安装CentOs6.4的过程: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12 ...

  4. IOS深入学习(19)之View object

    1 前言 本章主要介绍了View视图对象,包括了其属性,视图间关系和CALayer的简介. 英文原文:http://blog.csdn.net/developer_zhang/article/deta ...

  5. C# List 中 Find 方法

    实例化一个集合 List<User> userCollection = new List<User>(); userCollection.Add(new User(1, &qu ...

  6. wpf图片切换,幻灯效果

    xaml: <Window x:Class="WpfApplication1.PicShow" xmlns="http://schemas.microsoft.co ...

  7. jquery视频展示 图片轮播

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  8. JSP中的TAG

    http://blog.csdn.net/hongweigg/article/details/12006849 JSP标签有两种实现方法,一种是使用tag 文件,一种是使用tld文件. 1.使用tag ...

  9. C++之vector中元素删除

    今天在删除vector中的元素中遇到一个问题,这里记录下来以便以后查阅. 预备知识:用到了erase()函数,对于一个容器c来说,假设迭代器为p,那么执行: c.erase(p)之后就删除了容器c中p ...

  10. Nmap 源代码学习四 软件简单使用

    软件安装环境是win7.使用Zenmap, nmap6.49BETA2 扫描主机port nmap -T4 -A -v 192.168.0.207 输出结果: 扫描整个子网 nmap 192.168. ...