如何在maven项目中引用领一个项目

1 有两个项目 maven01  和maven 02,想在maven 02中引用maven01的方法,该如何操作呢

maven01中Factory类中的方法

public class Factory {
public static String createMessage(){
String message = "hello maven1";
return message;
}
}

maven02中引用Factory类中的方法,只需要在pom.xml里配置依赖

<dependency>
<groupId>zzqq-test</groupId>
<artifactId>maven01</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

 

posted @ 2018-03-09 15:50  逆水乘舟,不进则退  阅读(178)  评论(0编辑  收藏  举报