• 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. tableviewcell 系统工具删除:左滑删除,选中多个删除

    在编辑tableview的时候,我们有时候会需要编辑对一些cell进行删除(增加),在这个时候,我们最好用系统的方法来进行增删的操作 // // text1Controller.m // text / ...

  2. android shape(如自定义Button)

    Shape 前言:有时候会去自己去画一些Button的样式来展现在UI当中,其中主要用到的就是Shape 先来看一段代码: <?xml version="1.0" encod ...

  3. [GUI]界面开发类库-Ribbon风格 [转]

    [GUI]界面开发类库 如果我们不十分清楚需要什么样的界面风格及如何实现,请按以下两个步骤操作: (1)       搞清楚这种风格叫什么名字 (2)       查现有的比较著名的GUI库是否已有相 ...

  4. 压力测试工具:tsung

    http://tsung.erlang-projects.org/user_manual/introduction.html#what-is-tsung

  5. JavaScript的因为所以

    各位看官,楼主开始说过写几篇博客,这是这个系列的最后一集.吾以为:了解JavaScript的身世之谜,掌握其近乎心想事成的变量系统,了解其解析运行的偷梁换柱之法,熟悉布大师迂回曲折的OOP实现.那你离 ...

  6. Ext.form.ComboBox 后台取值 动态加载 ext5.0.0

    我用的extjs是5.0.0版本的. 请注意:如果这里没有的combobox相关内容,这里一定有. 开始的时候keyup事件取到的数据就是放不到ComboBox中,放全局变量也不好用.最后大神出手帮忙 ...

  7. Android studio启动后无法更新

    I'm trying to run android-studio 1.0 on ubuntu using start up script but as i'm behind proxy the and ...

  8. ZooKeeper是什么?

    What is ZooKeeper? (译:什么是ZooKeeper?) ZooKeeper is a centralized service for maintaining configuratio ...

  9. windows下安装,配置gcc编译器

    在Windows下使用gcc编译器: 1.首先介绍下MinGW MinGW是指仅仅用自由软件来生成纯粹的Win32可运行文件的编译环境,它是Minimalist GNU on Windows的略称. ...

  10. UVALive 4192 Close Enough Computations 水题

    Close Enough Computations 题目连接: https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge& ...