</h1>
<div class="clear"></div>
<div class="postBody">
* 配置好jdk
* 下载安装maven
http://maven.apache.org/download.cgi
* 解压到G:\apache-maven-3.5.3-bin
* 添加环境变量
** 添加 M2_HOME 和 MAVEN_HOME 环境变量到 Windows 环境变量,并将其指向你的 Maven 文件夹
** Path环境变量添加 %M2_HOME%\bin
* 查看mvn版本
1
|
mvn -version
|
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: G:\apache-maven-3.5.3-bin\bin\..
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_131\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
* mvn编译打包
** 先把命令行切换到Maven项目的根目录
1
|
cd
G:\eclipse-workspace\platform\enso-admin
|
** 编译
1
|
mvn clean compile
|
output:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
[WARNING] [WARNING] Some problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'distributionManagement' (position: START_TAG seen ...</pluginRepositories>\r\n <distributionManagement>... @304:31) @ C:\Users\13352\.m2\settings.xml, line 304, column 31 [WARNING] [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.tsinghuadtv.enso:enso-admin:war:1.0 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.codehaus.jackson:jackson-core-asl:jar -> duplicate declaration of version 1.9.12 @ line 156, column 15 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.codehaus.jackson:jackson-mapper-lgpl:jar -> duplicate declaration of version 1.9.12 @ line 161, column 15 [WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 283, column 12 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------< com.tsinghuadtv.enso:enso-admin >------------------- [INFO] Building enso-admin 1.0 [INFO] --------------------------------[ war ]--------------------------------- [WARNING] The POM for commons-logging:commons-logging:jar:1.1.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details Downloading from aliyun-repo: http://maven.aliyun.com/nexus/content/groups/public/com/tflx/enso/service-collection/1.0-SNAPSHOT/maven-metadata.xml Downloading from aliyun-nexus: http://47.92.133.100:8081/repository/maven-public/com/tflx/enso/service-collection/1.0-SNAPSHOT/maven-metadata.xml Downloading from alimaven: http://maven.aliyun.com/nexus/content/groups/public/com/tflx/enso/service-collection/1.0-SNAPSHOT/maven-metadata.xml Downloaded from aliyun-nexus: http://47.92.133.100:8081/repository/maven-public/com/tflx/enso/service-collection/1.0-SNAPSHOT/maven-metadata.xml (1.2 kB at 4.3 kB/s) [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ enso-admin --- [INFO] Deleting G:\eclipse-workspace\platform\enso-admin\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ enso-admin --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 28 resources [INFO] [INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ enso-admin --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 323 source files to G:\eclipse-workspace\platform\enso-admin\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14.878 s [INFO] Finished at: 2018-08-03T10:54:39+08:00 [INFO] ------------------------------------------------------------------------
** 打包
1
|
mvn clean package
|
output:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
[WARNING] [WARNING] Some problems were encountered while building the effective settings [WARNING] Unrecognised tag: 'distributionManagement' (position: START_TAG seen ...</pluginRepositories>\r\n <distributionManagement>... @304:31) @ C:\Users\13352\.m2\settings.xml, line 304, column 31 [WARNING] [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.tsinghuadtv.enso:enso-admin:war:1.0 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.codehaus.jackson:jackson-core-asl:jar -> duplicate declaration of version 1.9.12 @ line 156, column 15 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.codehaus.jackson:jackson-mapper-lgpl:jar -> duplicate declaration of version 1.9.12 @ line 161, column 15 [WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 283, column 12 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------< com.tsinghuadtv.enso:enso-admin >------------------- [INFO] Building enso-admin 1.0 [INFO] --------------------------------[ war ]--------------------------------- [WARNING] The POM for commons-logging:commons-logging:jar:1.1.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ enso-admin --- [INFO] Deleting G:\eclipse-workspace\platform\enso-admin\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ enso-admin --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 28 resources [INFO] [INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ enso-admin --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 323 source files to G:\eclipse-workspace\platform\enso-admin\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ enso-admin --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ enso-admin --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 18 source files to G:\eclipse-workspace\platform\enso-admin\target\test-classes [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ enso-admin --- [INFO] Surefire report directory: G:\eclipse-workspace\platform\enso-admin\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] — exec-maven-plugin:1.6.0:exec (exec-npm-install) @ enso-admin —
npm WARN admin@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {“os”:“darwin”,“arch”:“any”} (currup to date in 14.132s
ent: {“os”:“win32”,“arch”:“x64”})
[INFO]
[INFO] — exec-maven-plugin:1.6.0:exec (exec-npm-run-build) @ enso-admin —
> admin@1.0.0 build G:\eclipse-workspace\platform\enso-admin\frontend\admin
> node build/build.js
Happy[babel]: Version: 4.0.1. Threads: 3
Happy[babel]: All set; signaling webpack to proceed.
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
Hash: 7606a9eb6d96668d7d01
Version: webpack 2.5.1
Time: 24456ms
Asset Size Chunks Chunk Names
1.7606.js.map 1.08 MB 1 [emitted]
0.7606.js 414 kB 0 [emitted] [big]
2.7606.js 343 kB 2 [emitted] [big]
3.7606.js 259 kB 3 [emitted] [big]
4.7606.js 254 kB 4 [emitted] [big]
5.7606.js 155 kB 5 [emitted]
6.7606.js 153 kB 6 [emitted]
7.7606.js 162 kB 7 [emitted]
8.7606.js 22.1 kB 8 [emitted]
9.7606.js 18.7 kB 9 [emitted]
10.7606.js 9.64 kB 10 [emitted]
11.7606.js 11.7 kB 11 [emitted]
12.7606.js 10.4 kB 12 [emitted]
13.7606.js 9.49 kB 13 [emitted]
14.7606.js 3.42 kB 14 [emitted]
15.7606.js 9.21 kB 15 [emitted]
cmpt.lib.7606.js 639 kB 16 [emitted] [big] cmpt.lib
main.7606.js 254 kB 17 [emitted] [big] main
cmpt.style.7606.js 170 kB 18 [emitted] cmpt.style
0.7606.js.map 1.23 MB 0 [emitted]
1.7606.js 364 kB 1 [emitted] [big]
2.7606.js.map 1.03 MB 2 [emitted]
3.7606.js.map 744 kB 3 [emitted]
4.7606.js.map 745 kB 4 [emitted]
5.7606.js.map 474 kB 5 [emitted]
6.7606.js.map 466 kB 6 [emitted]
7.7606.js.map 493 kB 7 [emitted]
8.7606.js.map 68.1 kB 8 [emitted]
9.7606.js.map 56.6 kB 9 [emitted]
10.7606.js.map 30 kB 10 [emitted]
11.7606.js.map 34.3 kB 11 [emitted]
12.7606.js.map 32.3 kB 12 [emitted]
13.7606.js.map 27.6 kB 13 [emitted]
14.7606.js.map 10.3 kB 14 [emitted]
15.7606.js.map 27.6 kB 15 [emitted]
cmpt.lib.7606.js.map 2.61 MB 16 [emitted] cmpt.lib
main.7606.js.map 991 kB 17 [emitted] main
cmpt.style.7606.js.map 198 kB 18 [emitted] cmpt.style
favicon.png 839 bytes [emitted]
index.html 458 bytes [emitted]
[INFO]
[INFO] — maven-war-plugin:3.0.0:war (default-war) @ enso-admin —
[INFO] Packaging webapp
[INFO] Assembling webapp [enso-admin] in [G:\eclipse-workspace\platform\enso-admin\target\enso-admin-1.0]
[INFO] Processing war project
[INFO] Copying webapp resources [G:\eclipse-workspace\platform\enso-admin\webapp]
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
[INFO] Webapp assembled in [6948 msecs] [INFO] Building war: G:\eclipse-workspace\platform\enso-admin\target\enso-admin-1.0.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:18 min [INFO] Finished at: 2018-08-03T10:57:50+08:00 [INFO] ------------------------------------------------------------------------
** 部署
# 根据上一步的输出 把 复制出来
1
2
3
|
copy G:\eclipse-workspace\platform\enso-admin\target\enso-admin-1.0.war G:\apache-tomcat-7.0.88-windows-x64\webapps\enso-admin.war
G:\apache-tomcat-7.0.88-windows-x64\bin\startup.bat
|
需要先设置环境变量 CATALINA_HOME
The CATALINA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
1
|
set
CATALINA_HOME=G:\apache-tomcat-7.0.88-windows-x64
|
再试启动tomcat
1
|
%CATALINA_HOME%\bin\startup.bat
|
Using CATALINA_BASE: "G:\apache-tomcat-7.0.88-windows-x64"
Using CATALINA_HOME: "G:\apache-tomcat-7.0.88-windows-x64"
Using CATALINA_TMPDIR: "G:\apache-tomcat-7.0.88-windows-x64\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_131"
Using CLASSPATH: "G:\apache-tomcat-7.0.88-windows-x64\bin\bootstrap.jar;G:\apache-tomcat-7.0.88-windows-x64\bin\tomcat-juli.jar"
** 配置不对 先停掉tomcat服务
1
2
|
%CATALINA_HOME%\bin\
shutdown
.bat
del %CATALINA_HOME%\webapps\enso-admin-1.0.war
|
** 修改配置
1
2
|
@doskey n2=
"C:\Program Files (x86)\Notepad++\notepad++.exe"
$*
n2 %CATALINA_HOME%\conf\server.xml
|
在server.xml文件的 </Host> 闭合标签前面添加一行
1
|
<
Context
docBase="enso-admin" path="/" reloadable="true" source="org.eclipse.jst.jee.server:enso-admin"/>
|
** 再启动
1
|
%CATALINA_HOME%\bin\startup.bat
|
** 数据库连接失败
1
2
|
set
PROJECT=enso-admin
n2 %CATALINA_HOME%\webapps\%PROJECT%\WEB-INF\classes\jdbc.properties
|
** 浏览器访问
先试试 http://localhost:8080/enso-admin
然后重启tomcat
1
2
|
%CATALINA_HOME%\bin\
shutdown
.bat
%CATALINA_HOME%\bin\startup.bat
|
再访问 http://localhost:8080/
<div class="clear"></div>
<div id="post_next_prev">
<a href="https://www.cnblogs.com/mingzhanghui/p/9409336.html" class="p_n_p_prefix">« </a> 上一篇: <a href="https://www.cnblogs.com/mingzhanghui/p/9409336.html" title="发布于 2018-08-02 19:23">javascript 实现php str_pad</a>
<br>
<a href="https://www.cnblogs.com/mingzhanghui/p/9314649.html" class="p_n_p_prefix">» </a> 下一篇: <a href="https://www.cnblogs.com/mingzhanghui/p/9314649.html" title="发布于 2018-08-03 14:00">PHP 流行的框架</a>
<div class="feedbackItem">
<div class="feedbackListSubtitle">
<div class="feedbackManage">
</div>
<!-- Title -->
<span id="comment-maxId" style="display:none">4410130</span>
<span id="comment-maxDate" style="display:none">2019/10/31 上午10:04:10</span>
<!-- PostDate -->
2019-10-31 10:04
<!--NameLink-->
<a id="a_comment_author_4410130" href="https://www.cnblogs.com/xiaohaitun/" target="_blank">抓狂的蜗牛</a>
<div class="feedbackCon">
</div>
</div>
</div>
<div id="google_ads_iframe_/1090369/C2_0__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/1090369/C2_0" title="3rd party ad content" name="google_ads_iframe_/1090369/C2_0" width="468" height="60" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" srcdoc="" style="border: 0px; vertical-align: bottom;" data-google-container-id="2" data-load-complete="true"></iframe></div></div>
</div>
<div id="under_post_kb">
· 新突破:一次抽血可识别 50 多种癌症,误检率不到 1%
· 瑞幸财务造假22亿,为什么它不能好好卖咖啡?
· 特斯拉交付量和产量让多头“松了口气” 中国制造与需求开始反弹
· 在健康与维持生计之间挣扎 亚马逊司机担心3天感染了1000人
· Eclipse 基金会推出 Visual Studio Code 的替代 Eclipse Theia
» 更多新闻...
<div id="sideBar">
<div id="sideBarMain">
<div id="profile_block">
昵称:
<a href="https://home.cnblogs.com/u/mingzhanghui/">
mingzhanghui
</a>
<br>
园龄:
<a href="https://home.cnblogs.com/u/mingzhanghui/" title="入园时间:2014-04-16">
5年11个月
</a>
<br>
粉丝:
<a href="https://home.cnblogs.com/u/mingzhanghui/followers/">
0
</a>
<br>
关注:
<a href="https://home.cnblogs.com/u/mingzhanghui/followees/">
38
</a>
<div id="p_b_follow">
+加关注
<div id="calendar"><div id="blog-calendar" style="">
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
29 | 30 | 31 | 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 | 1 | 2 | |||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
常用链接
-
</ul>
我的标签
<li> <a href="https://www.cnblogs.com/mingzhanghui/tag/javascript/">javascript</a>(47) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/php/">php</a>(32) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/algorithm/">algorithm</a>(12) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/java/">java</a>(11) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/design%20pattern/">design pattern</a>(8) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/html/">html</a>(5) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/windows/">windows</a>(5) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/vue/">vue</a>(4) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/%E5%89%8D%E7%AB%AF%E6%A1%86%E6%9E%B6/">前端框架</a>(4) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/string/">string</a>(4) </li> <li> <a href="https://www.cnblogs.com/mingzhanghui/tag/">更多</a> </li> </ul>
随笔档案
2018年8月(38)</h3> <ul> <li>
2018年7月(64)</li> <li>
2018年6月(20)</li> <li>
</li> </ul> </div>
阅读排行榜
评论排行榜
推荐排行榜