1
我試圖將Spring BOM添加到我的項目中。我的POM在下面。使用maven-war-plugin和spring BOM
- 我在這裏沒有做正確的事情嗎?
此外,一個半相關的問題:爲什麼spring-ws,spring-data-jpa和其他版本號與spring core,context等版本不一致?
<build> <finalName>myproject</finalName> <plugins> <plugin> <version>3.1</version> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-framework-bom</artifactId> <version>4.0.3.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> ... </dependencies> </dependencyManagement> <dependencies> <!-- Spring --> <dependency> <groupId>org.springframework.ws</groupId> <artifactId>spring-ws-core</artifactId> <version>${spring-ws.version}</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>${spring-data-jpa.version}</version> </dependency> ... </dependencies>
它產生以下錯誤:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.863s
[INFO] Finished at: Fri May 09 13:15:24 EDT 2014
[INFO] Final Memory: 17M/214M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on
project myproject: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin
:2.1.1:war failed: For artifact {org.springframework:spring-core:null:jar}: The version cannot be em
pty. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plug
ins:maven-war-plugin:2.1.1:war (default-war) on project myproject: Execution default-war o
f goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war failed: For artifact {org.springframework
:spring-core:null:jar}: The version cannot be empty.
這是票。謹慎回答我的第二個問題以獲得最佳答案? – kwikness
我不完全確定Spring團隊如何或爲什麼版本如此。我的猜測是他們認爲他們是獨立的套房。注意組ID是不同的。也許Spring團隊在他們的主網站上有版本策略? – user944849