1、简单搭建maven集成开发环境

一、     Jetty安装

下载地址(包涵windows和Linux各版本,Jetty9需要JDK7):http://download.eclipse.org/jetty/

Jetty安装非常简单,只需要解压安装包即可启动Jetty服务。

JETTY_VERSION=xxx

wget http://download.eclipse.org/jetty/$JETTY_VERSION/dist/jetty-distribution-$JETTY_VERSION.tar.gz

tarxfz jetty-distribution-$JETTY_VERSION.tar.gz

cd jetty-distribution-$JETTY_VERSION

java-jar start.jar

Jetty的简单测试(我们用Jetty8):

test.war模块里面有一个dump的Servlet,它可以查看当前请求的Request/Session/Cookie信息。http://c909511:8080/dump/info这里面返回信息非常丰富,后续可以使用此方法调试当前请求信息:

二、     Jetty与Eclipse集成

1、 下载Eclipse工具:

http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/SR1/eclipse-jee-luna-SR1-win32-x86_64.zip

2、  安装Jetty组件

3、  配置Jetty

4、  配置完成后启动Jetty服务

三、Maven与Eclipse集成

1、 下载Maven工具http://maven.apache.org/download.html

2、 安装Maven Integration for Eclipse插件

3、  安装Maven;

a)         解压Maven到本地目录,设置环境变量;

i.              MAVEN_HOME为:D:/tools/apache-maven-3.2.1,将bin设置到PATH,在PATH末尾添加:;%MAVEN_HOME%/bin;

ii.              测试MAVEN是否设置成功,在Windows终端输入:mvn –v

b)         设置Maven本地仓库

i.              在D:\tools\apache-maven-3.2.1\conf\settings.xml文件中修改localRepository节点值为D:\study\maven\jar,制定本地仓库地址;

ii.              配置本地仓库nexus(可选)

Nexus下载地址:http://download.sonatype.com/nexus/oss/nexus-2.5.1-bundle.zip

安装Nexus只需解压配置即可运行

配置Nexus服务

启动Nexus服务(如果运行提示拒绝访问,右键-》管理员身份运行)

登陆Nexus

配置Nexus中心仓库

Nexus+Maven配置

<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<name>Nexus Mirror</name>
<url>http://maven.oschina.net/content/groups/public</url>
</mirror> </mirrors> <profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<name>Nexus</name>
<url>http://localhost:8082/nexus/content/groups/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus</name>
<url>http://localhost:8082/nexus/content/groups/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles> <!-- activeProfiles
| List of profiles that are active for all builds.
|
<activeProfiles>
<activeProfile>alwaysActiveProfile</activeProfile>
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
</activeProfiles>
-->
<!--激活配置-->
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>

4、  eclipse配置Maven;

a)         设置Maven的Installations

b)         设置Maven的User Settings

5、  导入项目工程

a)         在Myeclipse中选择import…依次导入项目工程;

b)         设置启动各个工程的Maven构建

c)         完成环境搭建,启动看效果

--------开发环境准备完毕end------------------------------

2、maven常用操作

a、引入项目中的jar包(使用这种方式引入的JAR包在打包时不会一起打包,所以打包后找不到该JAR包)

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>0.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/test.jar</systemPath>
</dependency>

打包引用包处理方法

<dependency>
  <groupId>org.postgresql</groupId>
  <artifactId>postgresql</artifactId>
  <version>0.3</version>
  <scope>system</scope>
  <systemPath>${project.basedir}/src/main/resources/lib/test.jar</systemPath>
</dependency>

java集成开发环境常用操作集的更多相关文章

  1. JetBrains IntelliJ IDEA 2019 for Mac(Java集成开发环境) 2019.3.1

    IntelliJ IDEA 2019中文激活版已全新上线,intellij idea mac是目前编程人员最喜欢的Java集成开发环境,具备智能代码助手.代码自动提示.重构.J2EE支持.Ant.JU ...

  2. 【JAVA零基础入门系列】Day2 Java集成开发环境IDEA

    开发环境搭建好之后,还需要一个集成开发环境也就是IDE来进行编程.这里推荐的IDE是IDEA,那个老掉牙的Eclipse还是先放一边吧,(手动滑稽). IDEA的下载地址:http://www.jet ...

  3. Java 集成开发环境的介绍及下载

    集成开发环境(integrated development environment,JDE) 之前成功运行了Java小程序是经历了先在笔记本中编写源代码,然后通过命令行运行打开javac编译源文件, ...

  4. Java集成开发环境IDEA

    一,安装 1,从http://www.jetbrains.com/idea/download/下载最新的community(free)版本. 2,解压文件 3,进入解压目录下的bin目录 4,执行id ...

  5. 第一记 搭建Java集成开发环境

    一.JDK JDK可以前往oracle官网进行下载并进行安装(我这边使用的是jdk1.8版本,也推荐使用jdk1.8及以上的) 下图是默认路径安装完成后的截图 安装完成会产生这两个文件夹 二.配置环境 ...

  6. Java集成开发环境--Eclipse for J2EE配置JRE运行环境

    .d1 { border-style: none } .d2 { border-style: solid } .d3 { border-style: dotted } .d4 { border-sty ...

  7. Java - 集成开发环境Eclipse的使用方法和技巧

    00 - Eclipse教程 Eclipse 教程 01 - Eclipse设置编译和运行的环境 建议编译和运行的版本保持一致,否则请特别注意: 低编译,高运行 ---> 可行. 高编译,低运行 ...

  8. Eclipse简明使用教程(java集成开发环境)

    说明:我使用的是绿色便携版的Eclipse,免安装,解压就能用.链接:https://download.csdn.net/download/loongstyle/10700321 1_Eclipse中 ...

  9. mac下开发环境常用操作与命令

    [1] 修改hosts文件 vim /private/etc/hosts

随机推荐

  1. 配置到 Framework GAC(Global Assembly Cache) Assembly

    配置到 Framework 通常有两种方法,一种是直接把它放到GAC(Global Assembly Cache作用是可以存放一些有很多程序都要用到的公共Assembly)中 :另一种是把它们放到具体 ...

  2. Python函数:使用谷歌翻译翻译英语字符串

    代码是同事写的,我把它单独抠出来,可以作为工具函数使用.当然,性能还是个问题,有待解决. import random import cookielib import urllib import url ...

  3. activemq集群搭建Demo

    activemq5.14.5单节点安装Demo 第一步:创建集群目录 [root@node001 ~]# mkdir -p /usr/local/activemqCluster 复制单点至集群目录 [ ...

  4. Office办公 如何打印顺丰发票

    1 关注顺丰速递,我-我的钱包 2 我的钱包-发票申请 3 勾选要打印发票的项目,点击申请发票 4 点击提交,确认发送的邮箱(他是把PDF发到指定邮箱)   最后PDF效果如下             ...

  5. Python中的关键字的用法

    Python有哪些关键字 -Python常用的关键字 and, del, from, not, while, as, elif, global, or, with, assert, else, if, ...

  6. 设计模式在cocos2d-x中的使用--简单工厂模式(Simple Factory)

    什么是简单工厂模式? 从设计模式的类型上来说,简单工厂模式是属于创建型模式,又叫做静态工厂方法(Static Factory Method)模式.通过专门定义一个类来负责创建其它类的实例,被创建的实例 ...

  7. Visual studio之C# 重新定义Messbox的显示窗口位置

    背景 当前做的APP需要新建一个设置窗口,该设置窗口会出现在靠近屏幕边缘位置,但主窗口铺满屏幕,设置窗口会弹出一些讯息,但默认情况下Messagebox窗口会居中于主窗口,这不太符合要求,正常应该居中 ...

  8. Android源代码装饰模式---ContextWrapper

    假设说Android源代码中哪个地方装饰模式应用的最明显的话,那肯定是非ContextWrapper莫属了,ContextWrapper是一个透明的经典的装饰模式.本文将通过装饰器模式分析Contex ...

  9. PHP-PHP5.3及以上版本中检查json格式的方法

    function is_json($string) { json_decode($string); return (json_last_error() == JSON_ERROR_NONE); } j ...

  10. java基础讲解13-----集合

    一:集合介绍 import java.util.ArrayList;import java.util.Collection;import java.util.Iterator; public clas ...