• 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. Android 当媒体变更后,通知其他应用重新扫描

    在媒体文件改变后 发出 Intent.ACTION_MEDIA_SCANNER_SCAN_FILE广播,告知其他应用,媒体文件发生改变. 具体代码片段: File oldFile = new File ...

  2. 创建类模式(五):单例(Singleton)

    定义 确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例. 单例模式一般情况下通过使用private的构造函数确保了在一个应用中只产生一个实例,并且是自行实例化. 和静态变量的区别 虽然 ...

  3. ios transition translate 闪屏问题总结

    webkit在绘制页面时会将结构分为各种层,当层足够大时就会变成很大的平铺层.这样一来webkit在每次页面结构发生变化时不需要都渲染整个页面而是渲染对应层了,这对渲染速度来说相当的重要.webkit ...

  4. WCF 客户端调用几种方式

    http://www..com/html/blogs/20130413/2116.htm CSDN123 http://developer.51cto.com/art/200911/161465.ht ...

  5. javascript 汉字生成拼音

    在网上下载的一个汉字生成拼音的js,很有用,大家一起分享! var PinYin = {"a":"/u554a/u963f/u9515","ai&qu ...

  6. 一些关于Block, ARC, GCD的总结

    基础解释不做.基础的东西链接如下: 1. Block:https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/Bl ...

  7. 【M10】在构造方法内阻止资源泄漏

    1.类中没有指针,如果对象构造过程中出现异常,C++保证已经构造好的那一部分自动销毁.注意:这里不是调用析构方法,而是编译器在你的构造方法中插入了一些代码,保证对已经构造好的对象析构. 2.类中有指针 ...

  8. 以优美方式编写JavaScript代码

    英文原文:CoffeeScript: The beautiful way to write JavaScript 我用 JavaScript 编程很多年了,写了大量的 JavaScript 代码,即便 ...

  9. asp.net 后台获取flv视频地址进行播放【转】

    源码下载:http://download.csdn.net/detail/njxiaogui/7609687 前台:.aspx <table> <tr> <td>& ...

  10. HTML5 <script>元素async,defer异步加载

    原文地址:HTML5′s async Script Attribute原文日期: 2010年09月22日翻译日期: 2013年08月22日 (译者注: 异步加载,可以理解为无阻塞并发处理.) (译者再 ...