Mac10.9用brew搭建Eclipse4.4+Maven3.2.3+JDK1.8运行环境
目录 |
目的 |
${basedir} |
存放 pom.xml和所有的子目录 |
${basedir}/src/main/java |
项目的 java源代码 |
${basedir}/src/main/resources |
项目的资源,比如说 property文件 |
${basedir}/src/test/java |
项目的测试类,比如说 JUnit代码 |
${basedir}/src/test/resources |
测试使用的资源 |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
mvn archetype:create 创建Maven项目 mvn compile 编译源代码 mvn deploy 发布项目 mvn test -compile 编译测试源代码 mvn test 运行应用程序中的单元测试 mvn site 生成项目相关信息的网站 mvn clean 清除项目目录中的生成结果 mvn package 根据项目生成的jar mvn install 在本地Repository中安装jar mvn eclipse:eclipse 生成eclipse项目文件 mvnjetty:run 启动jetty服务 mvntomcat:run 启动tomcat服务 mvn clean package -Dmaven. test .skip= true :清除以前的包后重新打包,跳过测试类 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
➜ ~ pwd /Users/lion/ ➜ ~ brew cask search java ==> Removing legacy Tap ==> Adding caskroom Tap Cloning into '/usr/local/Library/Taps/caskroom/homebrew-cask' ... remote: Counting objects: 51450, done . remote: Compressing objects: 100% (64 /64 ), done . remote: Total 51450 (delta 37), reused 5 (delta 2) Receiving objects: 100% (51450 /51450 ), 16.61 MiB | 26.00 KiB /s , done . Resolving deltas: 100% (31783 /31783 ), done . Checking connectivity... done . Tapped 1 formula ==> We need to make Caskroom for the first time at /opt/homebrew-cask/Caskroom ==> We 'll set permissions properly so we won' t need sudo in the future Password: ==> Exact match java ==> Partial matches eclipse-java javafx-scene-builder ➜ ~ brew cask info java java: 1.8.0_20 http: //www .oracle.com /technetwork/java/javase/downloads/jdk8-downloads-2133151 .html /opt/homebrew-cask/Caskroom/java/1 .8.0_20 (2 files, 210M) https: //github .com /caskroom/homebrew-cask/blob/master/Casks/eclipse-java .rb ==> Contents JDK 8 Update 20.pkg ( install ) ==> Caveats This Cask makes minor modifications to the JRE to prevent issues with packaged applications, as discussed here: https: //bugs .eclipse.org /bugs/show_bug .cgi? id =411361 If your Java application still asks for JRE installation, you might need to reboot or logout /login . Installing this Cask means you have AGREED to the Oracle Binary Code License Agreement for Java SE at http: //www .oracle.com /technetwork/java/javase/terms/license/index .html ➜ ~ brew cask install java ==> Caveats This Cask makes minor modifications to the JRE to prevent issues with packaged applications, as discussed here: https: //bugs .eclipse.org /bugs/show_bug .cgi? id =411361 If your Java application still asks for JRE installation, you might need to reboot or logout /login . Installing this Cask means you have AGREED to the Oracle Binary Code License Agreement for Java SE at http: //www .oracle.com /technetwork/java/javase/terms/license/index .html ==> Downloading http: //download .oracle.com /otn-pub/java/jdk/8u20-b26/jdk-8u20-ma ######################################################################## 100.0% ==> Running installer for java; your password may be necessary. ==> Package installers may write to any location; options such as --appdir are ignored. Password: ==> installer: Package name is JDK 8 Update 20 ==> installer: Installing at base path / ==> installer: The install was successful. java installed to '/opt/homebrew-cask/Caskroom/java/1.8.0_20' (2 files, 210M) ➜ ~ java -version java version "1.8.0_20" Java(TM) SE Runtime Environment (build 1.8.0_20-b26) Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode) |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
➜ ~ brew info maven maven: stable 3.2.3 http: //maven .apache.org/ Not installed From: https: //github .com /Homebrew/homebrew/blob/master/Library/Formula/maven .rb ➜ ~ brew install maven ==> Downloading http: //www .apache.org /dyn/closer .cgi?path=maven /maven-3/3 .2.3 /bi ==> Best Mirror http: //mirrors .cnnic.cn /apache/maven/maven-3/3 .2.3 /binaries/apac ######################################################################## 100.0% /usr/local/Cellar/maven/3 .2.3: 76 files, 8.0M, built in 4 seconds ➜ ~ which mvn && mvn --version /usr/local/bin/mvn Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:10+08:00) Maven home: /usr/local/Cellar/maven/3 .2.3 /libexec Java version: 1.8.0_20, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1 .8.0_20.jdk /Contents/Home/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "mac os x" , version: "10.9" , arch: "x86_64" , family: "mac" |
1
2
|
➜ ~ mkdir /Users/lion/Documents/_my_soft/mavenrepo ➜ ~ vi /usr/local/Cellar/maven/3 .2.3 /libexec/conf/settings .xml |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<? xml version = "1.0" encoding = "UTF-8" ?> < settings xmlns = "http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" > <!-- 设置Maven仓库的存放位置 --> < localRepository >/Users/lion/Documents/_my_soft/mavenrepo</ localRepository > < pluginGroups > </ pluginGroups > < proxies > </ proxies > < servers > </ servers > < mirrors > </ mirrors > < profiles > </ profiles > </ settings > |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
➜ ~ brew cask search eclipse ==> Partial matches eclipse-ide eclipse-jee nodeclipse eclipse-java eclipse-platform ➜ ~ brew cask info eclipse-ide eclipse-ide: 4.4.0 http: //eclipse .org/ Not installed https: //github .com /caskroom/homebrew-cask/blob/master/Casks/eclipse-ide .rb ==> Contents eclipse /Eclipse .app (link) ➜ ~ brew cask install eclipse-ide ==> Downloading http: //download .eclipse.org /technology/epp/downloads/release/lun ######################################################################## 100.0% ##可以看到Eclipse被安装到了目录/Users/lion/Applications/下面 ==> Symlinking App 'Eclipse.app' to '/Users/lion/Applications/Eclipse.app' eclipse-ide installed to '/opt/homebrew-cask/Caskroom/eclipse-ide/4.4.0' (1461 files, 227M) |
#在浏览器打开:http://www.eclipse.org/m2e/download/,然后同时将install的图标拖动到Eclipse Marketplace中,会弹出一个窗口,点击Confirm,后面就继续下一步,就完成了在线安装的过程。如下图:
#安装完后,会提示让你重启Eclipse,重启后进入初始页面会发现如下变化,同时点击左上角菜单栏的Eclipse->Preferences,也可以看到我们现在有了Maven配置项,如下图:
4.7、修改Eclipse4.4的Maven配置
#配置Eclipse使用我们刚刚安装的Maven,在菜单栏点击Window->Preferences,打开参数配置窗口,点击Mavek->Installations,然后点击右侧的Add,添加我们刚才安装的Maven路径,如下图:
#让Eclipse的Maven插件使用我们自定义的setting.xml文件,在菜单栏点击Window->Preferences,打开参数配置窗口,点击Mavek->User Settings,然后在Global Settings和User Settings中输入:/usr/local/Cellar/maven/3.2.3/libexec/conf/settings.xml,如下图:
4.6、用Maven创建一个Hello World
参考文章《maven3.2.3+eclipse4.4+JDK1.8+win8.1_64bit环境搭建》,demo可以复用。
4.7、用Maven创建项目的pom.xml简单介绍
参考文章《maven3.2.3+eclipse4.4+JDK1.8+win8.1_64bit环境搭建》,demo可以复用。
4.8、使用Eclipse打开Maven创建的项目,在控制台输出Hello World
参考文章《maven3.2.3+eclipse4.4+JDK1.8+win8.1_64bit环境搭建》,demo可以复用。
5、扩展阅读
Maven3常用POM属性及Settings属性介绍:http://blog.csdn.net/lgm277531070/article/details/6922645
Maven Settings:http://maven.apache.org/ref/3.2.3/maven-settings/settings.html
Maven pom.xml 配置详解:http://blog.csdn.net/ithomer/article/details/9332071
POM Reference:http://maven.apache.org/pom.html
Mac10.9用brew搭建Eclipse4.4+Maven3.2.3+JDK1.8运行环境的更多相关文章
- 搭建Linux(Ubuntu)系统下的Differential Datalog运行环境
DDlog is a bottom-up, incremental, in-memory, typed Datalog engine. It is well suited for writing pr ...
- ubuntu16.04搭建jdk1.8运行环境
搭建环境:Ubuntu 16.04 ×64 JDK :jdk-8u171-linux-x64.tar.gz 首先下载linux对应的安装包下载地址:http://www.oracle.com/tech ...
- ubuntu 搭建jdk1.8运行环境
参照了:https://blog.csdn.net/smile_from_2015/article/details/80056297 首先下载linux对应的安装包 下载地址:http://www.o ...
- MAC 下用 brew 搭建 PHP 开发环境
Mac下用brew搭建PHP(LNMP/LAMP)开发环境 Mac下搭建lamp开发环境很容易,有xampp和mamp现成的集成环境.但是集成环境对于经常需要自定义一些配置的开发者来说会非常麻烦,而且 ...
- 在MAC上搭建cordova3.4.0的IOS和android开发环境
Hello,大家好,今天给大家说说在mac上搭建cordova3.4.0的iOS和Android开发环境,首先下载cordova,地址:https://cordova.apache.org/#down ...
- 自动化测试 Appium之Python运行环境搭建 Part1
Appium之Python运行环境搭建 Part1 by:授客 QQ:1033553122 实践环境 Win7 Python 3.4.0 JAVA JDK 1.8.0_121 node.js8.11. ...
- VSCode搭建Java开发运行环境
用了一段时间VSCode,觉得还可以,想用VSCode整合不同的开发语言,于是研究了一下利用VSCode搭建Java环境.开发Java程序.网上这方面的帖子有不少,但每人的经历不同,把自己的经历记下来 ...
- 使用Docker搭建Java Web运行环境
这周末体验了一下挺火的Docker技术,记录学习笔记. >Docker是干什么的 Docker 是一个基于Linux容器(LXC-linux container)的高级容器引擎,基于go语言开发 ...
- Windows7 64位系统搭建Cocos2d-x-2.2.1最新版以及Android交叉编译环境(详细教程)
Windows7 64位系统搭建Cocos2d-x-2.2.1最新版以及Android交叉编译环境(详细教程) 声明:本教程在参考了以下博文,并经过自己的摸索后实际操作得出,本教程系本人原创,由于升级 ...
随机推荐
- iOS学习之SKTagView的使用
SKTagView是一款支持自动布局的标签tag. 特性: -流式展示标签 -可以配置标签的颜色.事件.间隔.外边距等 -支持Auto layout -可以在UITableViewCell中良好展示 ...
- Eclipse快捷键 10个最有用的快捷键
Eclipse中10个最有用的快捷键组合 一个Eclipse骨灰级开发者总结了他认为最有用但又不太为人所知的快捷键组合.通过这些组合可以更加容易的浏览源代码,使得整体的开发效率和质量得到提升. 1. ...
- Android四大组件-Activity
http://android.tgbus.com/Android/androidnews/201204/419485.shtml
- echo, print, print_r
echo 不是函数,没有返回值,因此只是用作输出的话会更快 print 和 print_r 有返回值,区别在于: print 用于打印一个字符串,print_r 可以打印一些复合类型,如: $arr= ...
- Elasticsearch学习之入门2
关于Elasticsearch的几个概念: 1)在Elasticsearch中,文档归属于类型type,而类型归属于索引index,为了方便理解,可以把它们与传统关系型数据库做类比: Relation ...
- 我的OpenCV学习笔记:VideoCapture类
opnCV 学习博客http://blog.csdn.net/thefutureisour/article/details/7472104 1 OpneCV中的数据共享机制 OpenCV是一个很不错 ...
- java经典题目
/***********Ryear.java begin********************/ import java.util.Scanner;public class Ryear { /** ...
- vimperator setting records
vimperator confugration files :highlight Hint color:#000;background:rgb(250,230,150);border-radius:4 ...
- Ubuntu 14.04中安装最新版Eclipse
Ubuntu 14.04中安装最新版Eclipse 来源:Linux社区 作者:Linux 1.安装OpenJDK Java 7 如果你的系统中没有安装Java,我们需要按照如下步骤事先安装好 ...
- ubuntu samba 服务器设置
安装 SAMBA 组件 sudo apt-get install samba smbfs smbclient ubuntu 14.04 使用以下方式安装: ? 1 2 3 4 5 6 7 若之前有安装 ...