1 回答

TA貢獻(xiàn)1834條經(jīng)驗(yàn) 獲得超8個(gè)贊
舊項(xiàng)目必須有一個(gè)帶有如下標(biāo)簽的 pom
<groupId>com.project</groupId>
<artifactId>old-project-name</artifactId>
<version>1.0.0</version>
<dependencies>
...
<!-- mysql as dependency if you want use it in new project -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
...
并且您需要將舊項(xiàng)目添加為新項(xiàng)目依賴項(xiàng)
在新項(xiàng)目 pom 中:
<dependencies>
...
<!-- old project -->
<dependency>
<groupId>com.project</groupId>
<artifactId>old-project-name</artifactId>
<version>1.0.0</version>
</dependency>
...
通過這種方式,新項(xiàng)目可以使用舊項(xiàng)目中的類和依賴項(xiàng),如 mysql
添加回答
舉報(bào)