您好,登錄后才能下訂單哦!
如何理解使用idea對(duì)多模塊項(xiàng)目進(jìn)行install遇到的問題,很多新手對(duì)此不是很清楚,為了幫助大家解決這個(gè)難題,下面小編將為大家詳細(xì)講解,有這方面需求的人可以來學(xué)習(xí)下,希望你能有所收獲。
此時(shí)為2019年8月22日晚上11點(diǎn)27分。
跟著黑馬程序員關(guān)于品優(yōu)購(gòu)項(xiàng)目開發(fā)時(shí),對(duì)pinyougou-servergoods-interface進(jìn)行maven install時(shí),出現(xiàn)了install失敗。具體異常如下:
一、'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing.
[WARNING] [WARNING] Some problems were encountered while building the effective model for com.xxx.xxx:xxxx:jar:0.0.1-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 72, column 12 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING]
對(duì)照官網(wǎng)用法:http://maven.apache.org/plugins/maven-compiler-plugin/usage.html
起初配置:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java.version}</source> <target>${java.version}</target> <encoding>${project.build.sourceEncoding}</encoding> </configuration> </plugin> </plugins> </build> * ${java.version} 為1.8 ${project.build.sourceEncoding} 為UTF-8
該問題解決辦法是需要置頂maven版本,解決辦法:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> <encoding>${project.build.sourceEncoding}</encoding> </configuration> </plugin> </plugins> </build>
二、Failed to execute goal on project pinyougou-sellergoods-interface: Could not resolve dependencies for project cn.pinyougou:pinyougou-sellergoods-interface:jar:1.0-SNAPSHOT: Failed to collect dependencies at cn.pinyougou:pinyougou-pojo:jar:1.0-SNAPSHOT。
分析:我的pinyougou-sellergoods-interface是依賴于pinyougou:pinyougou-pojo,已經(jīng)在pinyougou-sellergoods-interface的pom.xml文件中引入了pinyougou:pinyougou-pojo的依賴,但是使用maven的install命令還是打包不了jar包。解決方案是:
將父工程使用install打包,出錯(cuò)是必須的。因?yàn)檫€有其他子模塊沒有設(shè)定好依賴,暫時(shí)不管;
再使用maven的clean命令將父工程清除一下;
最后對(duì)需要打包的子模塊使用maven的install命令即可。
<!--spring web依賴--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <!-- 去除內(nèi)嵌tomcat --> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> <!--<scope>provided</scope>--> </dependency>
clean --- > install即可。
看完上述內(nèi)容是否對(duì)您有幫助呢?如果還想對(duì)相關(guān)知識(shí)有進(jìn)一步的了解或閱讀更多相關(guān)文章,請(qǐng)關(guān)注億速云行業(yè)資訊頻道,感謝您對(duì)億速云的支持。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。