自己开发的svn publisher插件在配置jenkins的maven构建项目时莫名报错的过程,idea排除maven依赖冲突
在自己开发了svn publisher插件,原来在自由风格的项目中使用没有任何问题,但是一旦把这个插件配置到maven风格的项目中,进入到参数构建页面没有出来我想要的界面(具体是出不来远程svn仓库的目录,这里不细说)。
插件中有以下代码
public SVNPublisher getSVNPublisher() { Job job = getParentJob(); XmlFile xmlFile = Items.getConfigFile(job); XStream xStream = xmlFile.getXStream(); Object o = xStream.fromXML(xmlFile.getFile()); if(o != null && o instanceof Project) { Project p = (Project) o; DescribableList list = p.getPublishersList(); for (Object o1 : list) { if(o1 instanceof SVNPublisher) { SVNPublisher sp = (SVNPublisher) o1; return sp; } } } return null; }
在这个方法的if(o != null && o instanceof Project) 判断中,这个判断只能判断两种类型的project
但是就不能判断maven风格的project,因此在maven项目中,这个方法的返回值就是null,导致在使用这个方法时,后面会报空指针异常。为了能让这个方法判断maven风格的项目,所以以上代码变成下面这样:
public SVNPublisher getSVNPublisher() { Job job = getParentJob(); XmlFile xmlFile = Items.getConfigFile(job); XStream xStream = xmlFile.getXStream(); Object o = xStream.fromXML(xmlFile.getFile()); if(o != null && o instanceof Project) { Project p = (Project) o; DescribableList list = p.getPublishersList(); for (Object o1 : list) { if(o1 instanceof SVNPublisher) { SVNPublisher sp = (SVNPublisher) o1; return sp; } } } else if(o != null && o instanceof MavenModuleSet) { MavenModuleSet mavenModuleSet = (MavenModuleSet) o; DescribableList<Publisher, Descriptor<Publisher>> publishersList = mavenModuleSet .getPublishersList(); for (Publisher publisher : publishersList) { if(publisher instanceof SVNPublisher) { SVNPublisher sp = (SVNPublisher) publisher; return sp; } } } return null; }
在if(o != null && o instanceof MavenModuleSet) 这个if判断中,MavenModuleSet 这个类所引用的jar包需要引入一下maven依赖
<dependency> <groupId>org.jenkins-ci.main</groupId> <artifactId>maven-plugin</artifactId> <version>2.17</version> </dependency>
但是一旦引入之后,再次编译项目,idea疯狂报依赖冲突
Failed while enforcing RequireUpperBoundDeps. The error(s) are [ Require upper bound dependencies error for com.jcraft:jsch.agentproxy.connector-factory:0.0.7 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ssh:2.12 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.9 , Require upper bound dependencies error for com.jcraft:jsch.agentproxy.core:0.0.7 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.7 +-com.jcraft:jsch.agentproxy.core:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:0.0.7 +-com.jcraft:jsch.agentproxy.core:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.7 +-com.jcraft:jsch.agentproxy.usocket-jna:0.0.7 +-com.jcraft:jsch.agentproxy.core:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.7 +-com.jcraft:jsch.agentproxy.usocket-nc:0.0.7 +-com.jcraft:jsch.agentproxy.core:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.7 +-com.jcraft:jsch.agentproxy.sshagent:0.0.7 +-com.jcraft:jsch.agentproxy.core:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.tmatesoft.svnkit:svnkit:1.9.3 +-com.jcraft:jsch.agentproxy.connector-factory:0.0.7 +-com.jcraft:jsch.agentproxy.pageant:0.0.7 +-com.jcraft:jsch.agentproxy.core:0.0.7 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ssh:2.12 +-com.jcraft:jsch.agentproxy.jsch:0.0.9 +-com.jcraft:jsch.agentproxy.core:0.0.9 , Require upper bound dependencies error for org.apache.maven:maven-embedder:3.1.0 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-embedder:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-agent:1.11 +-org.apache.maven:maven-embedder:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven31-agent:1.11 +-org.apache.maven:maven-embedder:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven32-agent:1.11 +-org.apache.maven:maven-embedder:3.2.3 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven33-agent:1.11 +-org.apache.maven:maven-embedder:3.3.1 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven35-agent:1.11 +-org.apache.maven:maven-embedder:3.5.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-interceptor:1.11 +-org.apache.maven:maven-embedder:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven31-interceptor:1.11 +-org.apache.maven:maven-embedder:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven32-interceptor:1.11 +-org.apache.maven:maven-embedder:3.2.3 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven33-interceptor:1.11 +-org.apache.maven:maven-embedder:3.3.1 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven35-interceptor:1.11 +-org.apache.maven:maven-embedder:3.5.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-interceptor-commons:1.11 +-org.apache.maven:maven-embedder:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.12.1 +-org.apache.maven:maven-embedder:3.1.0 , Require upper bound dependencies error for org.codehaus.plexus:plexus-classworlds:2.5.1 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.codehaus.plexus:plexus-classworlds:2.5.1 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-agent:1.11 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven31-agent:1.11 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven32-agent:1.11 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven33-agent:1.11 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven35-agent:1.11 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-embedder:3.1.0 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.3 +-org.codehaus.plexus:plexus-classworlds:2.5.2 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.12.1 +-org.codehaus.plexus:plexus-classworlds:2.5.1 , Require upper bound dependencies error for org.apache.maven:maven-core:3.1.0 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-interceptor:1.11 +-org.apache.maven:maven-core:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven31-interceptor:1.11 +-org.apache.maven:maven-core:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven32-interceptor:1.11 +-org.apache.maven:maven-core:3.2.3 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven33-interceptor:1.11 +-org.apache.maven:maven-core:3.3.1 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven35-interceptor:1.11 +-org.apache.maven:maven-core:3.5.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-interceptor-commons:1.11 +-org.apache.maven:maven-core:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-compat:3.1.0 +-org.apache.maven:maven-core:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-embedder:3.1.0 +-org.apache.maven:maven-core:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.12.1 +-org.apache.maven:maven-core:3.1.0 , Require upper bound dependencies error for org.apache.maven:maven-aether-provider:3.1.0 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-aether-provider:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-interceptor:1.11 +-org.apache.maven:maven-aether-provider:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven31-interceptor:1.11 +-org.apache.maven:maven-aether-provider:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven32-interceptor:1.11 +-org.apache.maven:maven-aether-provider:3.2.3 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven33-interceptor:1.11 +-org.apache.maven:maven-aether-provider:3.3.1 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.main.maven:maven3-interceptor-commons:1.11 +-org.apache.maven:maven-aether-provider:3.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-aether-provider:3.1.0 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.12.1 +-org.apache.maven:maven-aether-provider:3.1.0 , Require upper bound dependencies error for org.codehaus.plexus:plexus-utils:3.0.10 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-compat:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-aether-provider:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-embedder:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.3 +-org.codehaus.plexus:plexus-utils:3.0.17 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-http:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-file:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ssh:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ssh-external:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-provider-api:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.jenkins-ci.lib:lib-jenkins-maven-artifact-manager:1.2 +-org.codehaus.plexus:plexus-utils:2.0.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-webdav-jackrabbit:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-model:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-settings:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-settings-builder:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-repository-metadata:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-artifact:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.apache.maven:maven-model-builder:3.1.0 +-org.codehaus.plexus:plexus-utils:3.0.10 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven:maven-core:3.1.0 +-org.sonatype.plexus:plexus-sec-dispatcher:1.3 +-org.codehaus.plexus:plexus-utils:1.5.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ssh:2.12 +-org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6 +-org.codehaus.plexus:plexus-utils:1.4 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ssh:2.12 +-org.apache.maven.wagon:wagon-ssh-common:2.12 +-org.codehaus.plexus:plexus-utils:3.0.24 , Require upper bound dependencies error for org.apache.httpcomponents:httpclient:4.5.1 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.httpcomponents:httpclient:4.5.1 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-http:2.12 +-org.apache.httpcomponents:httpclient:4.5.2 , Require upper bound dependencies error for org.apache.httpcomponents:httpcore:4.4.3 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.httpcomponents:httpcore:4.4.3 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-http:2.12 +-org.apache.httpcomponents:httpcore:4.4.4 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.httpcomponents:httpclient:4.5.1 +-org.apache.httpcomponents:httpcore:4.4.3 , Require upper bound dependencies error for commons-net:commons-net:3.5 paths to dependency are: +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:maven-plugin:2.17 +-org.apache.maven.wagon:wagon-ftp:2.12 +-commons-net:commons-net:3.5 and +-io.jenkins.plugins:qt_jk_svnpublisher:1.0-SNAPSHOT +-org.jenkins-ci.main:jenkins-test-harness:2.49 +-org.jenkins-ci.main:jenkins-test-harness-htmlunit:2.31-2 +-commons-net:commons-net:3.6 ]
可以确定是引入这个依赖才出现的问题,所以接下来要做的就是把这个依赖中冲突错误所包含的包从这个依赖中排除掉
我们找到 Require upper bound dependencies error for commons-net:commons-net:3.5 paths to dependency are: 类似这样的话 ,只需要关注 commons-net:commons-net:3.5 这块gav 坐标中的 groupid 和 artifactId,也就是 commons-net 和 commons-net,再把这块添加到 <exclusion> 标签内即可,最后我的maven 依赖如下
<dependency> <groupId>org.jenkins-ci.main</groupId> <artifactId>maven-plugin</artifactId> <version>2.17</version> <exclusions> <exclusion> <groupId>commons-net</groupId> <artifactId>commons-net</artifactId> </exclusion> <exclusion> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> </exclusion> <exclusion> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> </exclusion> <exclusion> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> </exclusion> <exclusion> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-classworlds</artifactId> </exclusion> <exclusion> <groupId>org.apache.maven</groupId> <artifactId>maven-aether-provider</artifactId> </exclusion> <exclusion> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> </exclusion> <exclusion> <groupId>org.apache.maven</groupId> <artifactId>maven-embedder</artifactId> </exclusion> <exclusion> <groupId>com.jcraft</groupId> <artifactId>jsch.agentproxy.core</artifactId> </exclusion> <exclusion> <groupId>com.jcraft</groupId> <artifactId>jsch.agentproxy.connector-factory</artifactId> </exclusion> </exclusions> </dependency>
经过这次排错,后面依赖冲突自己也会很有信心去解决。
本文来自博客园,作者:margo,转载请注明原文链接:https://www.cnblogs.com/ZMargo/articles/11103574.html