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. form表单提交时选择性传值到后台

    正常情况下form表单提交会把表单内的内容提交到后台,但是如果有些内容只是作为展示或者是标记而不想传到后台,我们采用如下方法: jsp页面如下,我们不想提交id为userIdMark和pwdMark的 ...

  2. ubuntu下cmake自动化编译的一个例子

    一个CMakeLists.txt的例子参考:https://www.hahack.com/codes/cmake/https://blog.csdn.net/afei__/article/detail ...

  3. [视频解说]Java(JDK的下载安装及第一个程序执行)

    (JDK的下载安装及第一个程序执行) 内容:Java JDK 的安装以及HelloWorld 程序的执行 欢迎童鞋们前往围观 http://v.youku.com/v_show/id_XODA3Mzk ...

  4. 十招让Ubuntu 16.04用起来更得心应手

    Ubuntu 16.04是一种长期支持版本(LTS),是Canonical承诺发布五年的更新版.也就是说,你可以让这个版本在电脑上运行五年!这样一来,一开始就设置好显得特别重要.你应该确保你的软件是最 ...

  5. 如何在 Ubuntu 上搭建网桥

    导读作为一个 Ubuntu 16.04 LTS 的初学者.如何在 Ubuntu 14.04 和 16.04 的主机上搭建网桥呢?顾名思义,网桥的作用是通过物理接口连接内部和外部网络.对于虚拟端口或者 ...

  6. 2017.12.14 Mybatis物理分页插件PageHelper的使用(一)

    参考来自: http://www.360doc.com/content/15/0728/15/12642656_487954693.shtml https://www.cnblogs.com/digd ...

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

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

  8. [Functional Programming ADT] Adapt Redux Actions/Reducers for Use with the State ADT

    By using the State ADT to define how our application state transitions over time, we clear up the ne ...

  9. Android常用传感器用法一览(3)

    Android 开发包标准有8个传感器: Sensor.TYPE_ACCELEROMETER o 加速度计 (X, Y, Z) m/s2 Sensor.TYPE_GYROSCOPE o 陀螺仪 (X, ...

  10. 修改PHP上传文件的大小限制

    Warning: POST Content-Length of 35052172 bytes exceeds the limit of 8388608 bytes in Unknown on line ...