执行“mvn dependency:tree -P profile文件 -e”命令,可得到如下形式的依赖文件
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.xingfei.blog:blog-xingfei-upload:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ com.xingfei.blog:blog-xingfei-parent:1.0-SNAPSHOT, D:\personal\jianyiblogv2\blog-xingfei-version0.2\pom.xml, line 245, column 21
[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]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building blog-xingfei-upload 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ blog-xingfei-upload ---
[INFO] com.xingfei.blog:blog-xingfei-upload:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.2.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.2.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.2.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.6:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.6:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.6:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.3.4.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.4.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.3.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.2.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:1.4.2.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.2.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.2.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.2.1:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.1:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.3:test
[INFO] | +- junit:junit:jar:4.12:compile
[INFO] | +- org.assertj:assertj-core:jar:2.5.0:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | | \- org.objenesis:objenesis:jar:2.1:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test
[INFO] | | \- org.json:json:jar:20140107:test
[INFO] | +- org.springframework:spring-core:jar:4.3.4.RELEASE:compile
[INFO] | \- org.springframework:spring-test:jar:4.3.4.RELEASE:test
[INFO] +- com.xingfei.blog:blog-xingfei-common:jar:1.0-SNAPSHOT:compile
[INFO] | +- taobao-sms:taobao-sms:jar:1.0:compile
[INFO] | +- javax.mail:javax.mail-api:jar:1.5.6:compile
[INFO] | +- com.sun.mail:javax.mail:jar:1.5.6:compile
[INFO] | | \- javax.activation:activation:jar:1.1:compile
[INFO] | +- tencent-qq:tencent-qq:jar:2.0:compile
[INFO] | \- commons-io:commons-io:jar:2.4:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-freemarker:jar:1.4.2.RELEASE:compile
[INFO] | +- org.freemarker:freemarker:jar:2.3.25-incubating:compile
[INFO] | \- org.springframework:spring-context-support:jar:4.3.4.RELEASE:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] +- com.alibaba:simpleimage:jar:1.2.3:compile
[INFO] | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | +- log4j:log4j:jar:1.2.12:compile
[INFO] | +- commons-logging:commons-logging:jar:1.0.4:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.21:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.springframework.boot:spring-boot-starter-cache:jar:1.4.2.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:4.3.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.2.RELEASE:compile
[INFO] | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.6:compile
[INFO] | | \- org.apache.tomcat:tomcat-juli:jar:8.5.6:compile
[INFO] | \- org.springframework:spring-jdbc:jar:4.3.4.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.3.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.2.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.3.4.RELEASE:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.40:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.8.4:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.4:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.4:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.8.4:compile
[INFO] | \- joda-time:joda-time:jar:2.9.5:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.8.4:compile
[INFO] +- com.alibaba:druid:jar:1.0.11:compile
[INFO] | +- com.alibaba:jconsole:jar:1.8.0:system
[INFO] | \- com.alibaba:tools:jar:1.8.0:system
[INFO] +- com.alibaba:fastjson:jar:1.2.7:compile
[INFO] +- org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:1.1.1:compile
[INFO] | \- org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:jar:1.1.1:compile
[INFO] | +- org.mybatis:mybatis:jar:3.4.0:compile
[INFO] | \- org.mybatis:mybatis-spring:jar:1.3.0:compile
[INFO] +- tk.mybatis:mapper-spring-boot-starter:jar:1.0.0:compile
[INFO] | +- tk.mybatis:mapper-spring-boot-autoconfigure:jar:1.0.0:compile
[INFO] | \- tk.mybatis:mapper:jar:3.3.9:compile
[INFO] | \- javax.persistence:persistence-api:jar:1.0:compile
[INFO] +- com.github.pagehelper:pagehelper-spring-boot-starter:jar:1.0.0:compile
[INFO] | +- com.github.pagehelper:pagehelper-spring-boot-autoconfigure:jar:1.0.0:compile
[INFO] | \- com.github.pagehelper:pagehelper:jar:5.0.0:compile
[INFO] | \- com.github.jsqlparser:jsqlparser:jar:0.9.5:compile
[INFO] +- com.alibaba:dubbo:jar:2.5.3:compile
[INFO] | +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] | \- org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | +- jline:jline:jar:0.9.94:compile
[INFO] | \- io.netty:netty:jar:3.7.0.Final:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-redis:jar:1.4.2.RELEASE:compile
[INFO] | \- org.springframework.data:spring-data-redis:jar:1.7.5.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.1.5.RELEASE:compile
[INFO] | | \- org.springframework.data:spring-data-commons:jar:1.12.5.RELEASE:compile
[INFO] | +- org.springframework:spring-oxm:jar:4.3.4.RELEASE:compile
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] +- redis.clients:jedis:jar:2.8.2:compile
[INFO] | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] +- com.github.sgroschupf:zkclient:jar:0.1:compile
[INFO] +- com.google.guava:guava:jar:19.0:compile
[INFO] +- com.dyuproject.protostuff:protostuff-core:jar:1.0.8:compile
[INFO] | \- com.dyuproject.protostuff:protostuff-api:jar:1.0.8:compile
[INFO] +- com.dyuproject.protostuff:protostuff-runtime:jar:1.0.8:compile
[INFO] | \- com.dyuproject.protostuff:protostuff-collectionschema:jar:1.0.8:compile
[INFO] \- weibo:weibo4j:jar:1.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.043 s
[INFO] Finished at: 2017-05-24T10:38:25+08:00
[INFO] Final Memory: 25M/336M
根据查看执行dependency tree获取得到的结果分析,我们的依赖关系中jcl-over-slf4j:jar:1.7.21冲突,根据下图,排除冲突解决
贴出我得错误日志
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/jenkins/blog-xingfei-upload/target/jianyiblog-file-upload-exec.jar!/BOOT-INF/lib/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/jenkins/blog-xingfei-upload/target/jianyiblog-file-upload-exec.jar!/BOOT-INF/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Found binding in [jar:file:/home/jenkins/blog-xingfei-upload/target/jianyiblog-file-upload-exec.jar!/BOOT-INF/lib/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/jenkins/blog-xingfei-upload/target/jianyiblog-file-upload-exec.jar!/BOOT-INF/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError.
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:72)
at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:45)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at com.xingfei.blog.BlogXingfeiUploadApplication.(BlogXingfeiUploadApplication.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521)
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
at org.slf4j.impl.Log4jLoggerFactory.(Log4jLoggerFactory.java:54)
... 16 more
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:72)
at org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:45)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at com.xingfei.blog.BlogXingfeiUploadApplication.(BlogXingfeiUploadApplication.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:521)
Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
at org.slf4j.impl.Log4jLoggerFactory.(Log4jLoggerFactory.java:54)
... 16 more
SSH: EXEC: completed after 41,019 ms
SSH: Disconnecting configuration [fei-ssh] ...
ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [1]]
Build step 'Send files or execute commands over SSH' changed build result to UNSTABLE
Finished: UNSTABLE