美文网首页
maven 遇到过的问题

maven 遇到过的问题

作者: 对方正在输出_ace | 来源:发表于2019-03-08 10:43 被阅读0次

    1.修改了pom文件后,出现了三个版本的同一种类型的jar包

    包依赖异常

    此时需要检查maven的setting.xml文件,看是不是有镜像不可用导致后续加载有问题。

    2.如果java和scala混编的时候,可能会出现无法编译scala只能编译java的情况,此时需要在pom文件里添加:

    <plugin>
                    <groupId>org.scala-tools</groupId>
                    <artifactId>maven-scala-plugin</artifactId>
                    <version>2.15.2</version>
                    <configuration>
                        <args>
                            <arg>
                                -g:vars
                            </arg>
                        </args>
                        <verbose>true</verbose>
                    </configuration>
                    <executions>
                        <execution>
                            <id>scala-compile-first</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>scala-test-compile</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
    </plugin>
    

    相关文章

      网友评论

          本文标题:maven 遇到过的问题

          本文链接:https://www.haomeiwen.com/subject/ogblpqtx.html