我有兩個模塊,A和B,它們在同一個父項下。現在A需要B作爲依賴。我不能只使用jar
作爲依賴類型,因爲模塊B使用spring-boot-maven-plugin
,所以我想知道如何設置A的POM配置,使A取決於B的編譯類而不是jar
?<Maven>如何在Maven項目中將類文件添加爲依賴項(不是jar)?
- root
- A
- src # module A's source code
- target
- classes # module A's compiled classes
- A.jar # module A's compiled jar output
- pom.xml # module A's mvn config
- B
- src # module B's source code
- target
- classes # module B's compiled classes, HOW CAN I IMPORT THESE TO A?
- B.jar # module B's mvn config
- pom.xml # module B's mvn config
- pom.xml # parent mvn config
父MVN配置
...
<modules>
<module>A</module>
<module>B</module>
</modules>
...
模塊A MVN配置
...
<parent>
<!- pointed to parent ->
</parent>
<dependencies>
<dependency>
<groupId></groupId>
<artifactId>B</artifactId>
<scope>??????????????</scope> # WHAT SHOULD I PUT HERE?
<type>???????????????</type> # WHAT SHOULD I PUT HERE?
</dependency>
<dependencies>
...
你需要B的類在運行時? – nullpointer