• 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. LPTSTR、LPCSTR、LPCTSTR、LPSTR的来源及意义

    UNICODE:它是用两个字节表示一个字符的方法.比如字符'A'在ASCII下面是一个字符,可'A'在UNICODE下面是两个字符,高字符用0填充,而且汉字'程'在ASCII下面是两个字节,而在UNI ...

  2. Lotus 迁移到Exchange POC 之安装Exchange 2010!

    我们登录到Exchange 2010服务器,双击setup 安装Exchange 2010,双击setup.exe完成安装:

  3. UI:转自互联网资料

      1.UIWindow和UIView和 CALayer 的联系和区别? 答:UIView是视图的基类,UIViewController是视图控制器的基类,UIResponder是表示一个可以在屏幕上 ...

  4. 在XAF(ASP.NET)中以ListEditor的形式调用百度地图API

    因为项目需要,在系统中使用地图显示设备的地理位置.考虑过ArgGIS,Bing和Baidu地图.本来想用ArgGIS,看教程嫌麻烦.所以还是用Web地图吧.Bing的话还要申请个key,没心情.百度地 ...

  5. Web性能优化之图片优化

    http://get.jobdeer.com/6513.get 其中APNG和WebP格式出现的较晚,尚未被Web标准所采纳,只有在特定平台或浏览器环境可以预知的情况下加以采用,虽然均可以在不支持的环 ...

  6. 为什么无法发起qq临时会话,必须添加好友?如何设置才能临时会话?

    (从已经死了一次又一次终于挂掉的百度空间人工抢救出来的,发表日期2014-06-03) 一. QQ等级低于10级不能进行临时会话 按照腾讯的设置,QQ等级如果低于10级(2个月亮+2颗星星),无法发起 ...

  7. 关于div的居中的问题

    (从已经死了一次又一次终于挂掉的百度空间人工抢救出来的,发表日期2014-01-11) div水平和垂直居中,text-align和vertical-align不起作用,因为标签div没有这两个属性, ...

  8. js 中使用工厂方法和构造器方法

    1 直接创建对象 <!DOCTYPE html> <html> <head lang="en"> <meta charset=" ...

  9. 由“大数据量Excel入库高效方式”瞥见“并联系统”之优势

    使用场景:         当你有一个Excel文件,需要把其中的数据高速录入到数据库中,文件中包含10万条以上数据. 设计方案:        我们将整个过程分成三个阶段,A(装载Excel文件). ...

  10. iOS开发——UI篇Swift篇&UITabBarController

    UITabBarController class UITabBarControllerController: UIViewController { var titleString:String! @I ...