Maven with Multi-module
Well, A project made of multi modules.
For example, the hongten-security project, the structure of the hongten-security project display as below(In eclipse tool):
and in the windows 7 operating system, the folder structure of the hongten-security project display as below,
then, you have TWO choices to run(or install) this project to you local liberary(repository).
The first one :
Back to eclipse tool, select the "Package explorer" window, and select the "/hongten-sesurity/pom.xml" to run(or install) this project.
The second:
Back to Window 7 operating system, go to the directory "D:\Development\j2ee\workspace\hongten-sesurity", and open the command window to run(or install) this project.
I will display with the second method, and type the command "mvn install" in the command window.
WOW, there is an ERROR!!!!
The Maven can NOT find the parent.relativePath , it means that the "security-parent" model must install before you run(or install) the "hongten-security" project.
en, you should go to the derictory "D:\Development\j2ee\workspace\hongten-sesurity\security-parent" to install "security-parent" model.
After installing the "security-parent" model, rember to back to parent folder("D:\Development\j2ee\workspace\hongten-sesurity")
and type the command "mvn install"
============================================
Source Code
============================================
/hongten-sesurity/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.b510.hongten</groupId>
<artifactId>hongten-sesurity</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging> <name>hongten-sesurity</name>
<url>http://maven.apache.org</url> <modules>
<module>security-parent</module>
<module>security-configuration</module>
<module>security-model</module>
<module>security-web</module>
</modules>
</project>
/security-configuration/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<groupId>com.b510.hongten</groupId>
<artifactId>security-parent</artifactId>
<version>0.0.1</version>
</parent> <artifactId>security-configuration</artifactId>
<name>security-configuration</name>
<packaging>jar</packaging> </project>
/security-model/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<groupId>com.b510.hongten</groupId>
<artifactId>security-parent</artifactId>
<version>0.0.1</version>
</parent> <artifactId>security-model</artifactId>
<name>security-model</name>
<packaging>pom</packaging> <modules>
<module>security-model-ai</module>
<module>security-model-xml</module>
</modules>
</project>
/security-model-ai/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<groupId>com.b510.hongten</groupId>
<artifactId>security-model</artifactId>
<version>0.0.1</version>
</parent> <artifactId>security-model-ai</artifactId>
<name>security-model-ai</name>
<packaging>jar</packaging> </project>
/security-model-xml/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<groupId>com.b510.hongten</groupId>
<artifactId>security-model</artifactId>
<version>0.0.1</version>
</parent> <artifactId>security-model-xml</artifactId>
<name>security-model-xml</name>
<packaging>jar</packaging> </project>
/security-parent/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <!-- security-parent -->
<groupId>com.b510.hongten</groupId>
<artifactId>security-parent</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging> <name>security-parent</name>
<url>http://maven.apache.org</url> <!-- All properties declare here -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.10</junit.version>
<hibernate.core.version>3.6.10.Final</hibernate.core.version>
<javassist.version>3.18.1-GA</javassist.version>
<mysql.connector.version>5.1.33</mysql.connector.version>
<log4j.version>1.2.17</log4j.version>
</properties> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Configuration for Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.core.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>${javassist.version}</version>
</dependency>
<!-- Configuration for mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
</dependency>
<!-- Configuration for log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>
</project>
/security-web/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <parent>
<groupId>com.b510.hongten</groupId>
<artifactId>security-parent</artifactId>
<version>0.0.1</version>
</parent> <artifactId>security-web</artifactId>
<name>security-web</name>
<packaging>jar</packaging> </project>
Source Code Download : http://files.cnblogs.com/hongten/hongten-sesurity.rar
Source Code Download : http://files.cnblogs.com/hongten/hongten-sesurity_with_dependencyManagement.rar
========================================================
More reading,and english is important.
I'm Hongten
大哥哥大姐姐,觉得有用打赏点哦!多多少少没关系,一分也是对我的支持和鼓励。谢谢。
Hongten博客排名在100名以内。粉丝过千。
Hongten出品,必是精品。
E | hongtenzone@foxmail.com B | http://www.cnblogs.com/hongten
========================================================
Maven with Multi-module的更多相关文章
- maven Dynamic Web Module 3.0 requires Java 1.6 or newer
maven Dynamic Web Module 3.0 requires Java 1.6 or newer CreateTime--2018年4月19日16:56:42 Author:Mary ...
- IDEA+Maven+多个Module模块(创建多模块SpringBoot整合项目)
最近在学习springboot,先从创建项目开始,一般项目都是一个项目下会有多个模块,这里先创建一个最简单的实例,一个项目下有一个springboot模块项目提供web服务,引用另一个java项目(相 ...
- [maven] "Dynamic Web Module 3.0 requires Java 1.6 or newer." OR "JAX-RS (REST Web Services) 2.0 requires Java 1.6 or newer."
在网上下载的开源工程,用maven构建的时候报错: Dynamic Web Module 3.0 requires Java 1.6 or newer. JAX-RS (REST Web Servic ...
- Maven Archetype 多 Module 自定义代码脚手架
大部分公司都会有一个通用的模板项目,帮助你快速创建一个项目.通常,这个项目需要集成一些公司内部的中间件.单元测试.标准的代码格式.通用的代码分层等等. 今天,就利用 Maven 的 Archetype ...
- 使用Maven运行测试提示Module sdk 1.5的解决方法
解决方法: 1. 配置Project Structure 2. 在MAVEN_HOME/conf/setting.xml中添加profile 3. 在Maven项目的pom.xml文件里添加标签 三种 ...
- 创建maven parent project & module project
1.命令方式: 1)Create the top-level root: mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.arc ...
- idea maven 项目 遇到 "Module not specified" 解决方法
1. 原因:我这边出现的原因是 其他同事在提交代码是 将 这个文件夹也提交了,idea 会加载 .idea 里的配置(即 他的配置),而我的 maven 配置不同,导致出错. 2. 解决方法:删除这 ...
- IDEA中导入Maven工程(module)
导入其它Maven工程时可能会出现依赖代码变红等等可以重新导入 右键pom.xml文件 --->Maven---->Reimport ,idea强制刷新内容,一般能解决依赖没有识别的问题 ...
- 【IDEA使用技巧】(4) —— IDEA 构建Java Maven项目、导入Eclipse项目、多Module Maven项目
1.IntelliJ IDEA构建Java Maven项目 1.1. IDEA构建Java Maven项目 ①选择Create New Project,选择创建Maven项目,并勾选Create fr ...
- Maven Module和Maven Project的区别
1.maven project和module相当于父子关系.2.当新建的项目中不存在父子关系时使用project.3.当项目中存在父子关系时用project做父工程,module做子工程,module ...
随机推荐
- [Eclipse][SVN] 在eclipse上安装SVN
以前装过好多次SVN,始终没有一次把安装过程记录下来,这次新装机器,安装SVN插件时一波三折,记录下来免得以后又忘记了. 方法一: 1. 直接通过后台添加URL通过互联网进行安装,直接上图: 2. ...
- Ubuntu下安装Nginx
转载自:http://www.cnblogs.com/skynet/p/4146083.html 1.Nginx安装 我使用的环境是64位 Ubuntu 14.04, Nginx是Nginx 1.10 ...
- Create a Qt Widget Based Application—Windows
This turtorial describes how to use Qt Creator to create a small Qt application, Text Finder. It is ...
- C[泊车管理系统]
// // main.c // 泊车管理系统 // // Created by 丁小未 on 13-7-14. // Copyright (c) 2013年 dingxiaowei. All ...
- 官方Tomcat 8.0.24 Web漏洞整改记录
测试环境 web服务器:apache-tomcat-8.0.24-windows-x64 测试工具:Acunetix Web Vulnerability Scanner 9.5 官方Tomcat测试结 ...
- Eclipse的详细安装步骤
第一种:这个方法是在线安装的 第二种:下载完整免安装包 首先打开网址:http://www.eclipse.org/ 然后在这里我就选择64位的安装,就以安装安卓开发的举例: 然后下载即可:
- Android 中常用的布局
一.线性布局----LinearLayout horizontal 水平 <?xml version="1.0" encoding="utf-8"?& ...
- poj 1273 最大流
题目链接:http://poj.org/problem?id=1273 a.EK算法:(Edmond-Karp): 用BFS不断找增广路径,当找不到增广路径时当前流量即为最大流. b.dinic算法: ...
- 安装PyMysql的基本步骤
X:\Users\**>c: c:\>cd python c:\Python>python ez_setup.py Downloading https://pypi.io/packa ...
- Angular JS学习之指令
1.Angular JS通过称为指令的新属性来扩展HTML:通过内置的指令来为应用添加功能: 2.AngularJS指令:AngularJS指令是扩展的HTML属性,带有前缀ng-: **ng-app ...