okhttp源码导入及Maven构建文件pom.xml的格式

 

okhttp是一个非常强大的网络框架,封装了http及https的网络协议实现,向上层提供统一的网络访问接口,熟悉一个框架最直接的办法是用起来,而想用好,少不了要熟悉了解其源码,RTFSC(Read The Fuck Source Code),okhttp的github路径为:

https://github.com/square/okhttp

拉取代码以后,发现是maven项目,一直在做Android项目,所用到构建为ant及后来的gradle,没怎么接触过maven,试着编了一下,有错误,没有直接通过,汗!!错误如下:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] OkHttp (Parent)                                                    [pom]
[INFO] OkHttp                                                             [jar]
[INFO] OkHttp test support classes                                        [jar]
[INFO] OkHttp Transport Layer Security (TLS)                              [jar]
[INFO] MockWebServer                                                      [jar]
[INFO] OkHttp URLConnection                                               [jar]
[INFO] OkHttp Logging Interceptor                                         [jar]
[INFO] OkHttp Tests                                                       [jar]
[INFO] OkHttp Android Platform Support                                    [jar]
[INFO] OkHttp Apache HttpClient                                           [jar]
[INFO] OkHttp Server-Sent Events                                          [jar]
[INFO] OkHttp DNS over HTTPS                                              [jar]
[INFO] OkCurl                                                             [jar]
[INFO] Samples (Parent)                                                   [pom]
[INFO] Sample: Guide                                                      [jar]
[INFO] Sample: Crawler                                                    [jar]
[INFO] Sample: Simple Client                                              [jar]
[INFO] Sample: Slack                                                      [jar]
[INFO] Sample: Static Server                                              [jar]
[INFO] Sample: UNIX domain sockets                                        [jar]
[INFO] Benchmarks                                                         [jar]
[INFO] 
[INFO] --------------------< com.squareup.okhttp3:parent >---------------------
[INFO] Building OkHttp (Parent) 3.12.0-SNAPSHOT                          [1/21]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ parent ---
[INFO] 
[INFO] --- animal-sniffer-maven-plugin:1.15:check (default) @ parent ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.17:checkstyle (default) @ parent ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ parent ---
[INFO] Installing /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/pom.xml to /Users/wangguoqiang/.m2/repository/com/squareup/okhttp3/parent/3.12.0-SNAPSHOT/parent-3.12.0-SNAPSHOT.pom
[INFO] 
[INFO] --------------------< com.squareup.okhttp3:okhttp >---------------------
[INFO] Building OkHttp 3.12.0-SNAPSHOT                                   [2/21]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ okhttp ---
[INFO] 
[INFO] --- templating-maven-plugin:1.0-alpha-3:filter-sources (default) @ okhttp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Source directory: /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/target/generated-sources/java-templates added.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ okhttp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ okhttp ---
[WARNING] Error injecting: org.apache.maven.plugin.compiler.CompilerMojo
java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/languages/java/jpms/LocationManager;
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
	at java.lang.Class.getDeclaredFields(Class.java:1916)
	at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675)
	at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
	at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:164)
	at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:613)
	at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:569)
	at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:555)
	at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:884)
	at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805)
	at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282)
	at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214)
	at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006)
	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038)
	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
	at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
	at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
	at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
	at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:519)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:124)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
	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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.languages.java.jpms.LocationManager
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	... 57 more
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] OkHttp (Parent) 3.12.0-SNAPSHOT .................... SUCCESS [  1.289 s]
[INFO] OkHttp ............................................. FAILURE [  0.480 s]
[INFO] OkHttp test support classes ........................ SKIPPED
[INFO] OkHttp Transport Layer Security (TLS) .............. SKIPPED
[INFO] MockWebServer ...................................... SKIPPED
[INFO] OkHttp URLConnection ............................... SKIPPED
[INFO] OkHttp Logging Interceptor ......................... SKIPPED
[INFO] OkHttp Tests ....................................... SKIPPED
[INFO] OkHttp Android Platform Support .................... SKIPPED
[INFO] OkHttp Apache HttpClient ........................... SKIPPED
[INFO] OkHttp Server-Sent Events .......................... SKIPPED
[INFO] OkHttp DNS over HTTPS .............................. SKIPPED
[INFO] OkCurl ............................................. SKIPPED
[INFO] Samples (Parent) ................................... SKIPPED
[INFO] Sample: Guide ...................................... SKIPPED
[INFO] Sample: Crawler .................................... SKIPPED
[INFO] Sample: Simple Client .............................. SKIPPED
[INFO] Sample: Slack ...................................... SKIPPED
[INFO] Sample: Static Server .............................. SKIPPED
[INFO] Sample: UNIX domain sockets ........................ SKIPPED
[INFO] Benchmarks 3.12.0-SNAPSHOT ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.020 s
[INFO] Finished at: 2018-08-28T15:53:36+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project okhttp: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile: Lorg/codehaus/plexus/languages/java/jpms/LocationManager;
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.7.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/wangguoqiang/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.7.0/maven-compiler-plugin-3.7.0.jar
[ERROR] urls[1] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-compiler-javac-errorprone/2.8.4/plexus-compiler-javac-errorprone-2.8.4.jar
[ERROR] urls[2] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[3] = file:/Users/wangguoqiang/.m2/repository/com/google/errorprone/error_prone_core/2.3.1/error_prone_core-2.3.1.jar
[ERROR] urls[4] = file:/Users/wangguoqiang/.m2/repository/com/google/errorprone/error_prone_annotation/2.3.1/error_prone_annotation-2.3.1.jar
[ERROR] urls[5] = file:/Users/wangguoqiang/.m2/repository/com/google/errorprone/error_prone_type_annotations/2.3.1/error_prone_type_annotations-2.3.1.jar
[ERROR] urls[6] = file:/Users/wangguoqiang/.m2/repository/com/google/errorprone/error_prone_check_api/2.3.1/error_prone_check_api-2.3.1.jar
[ERROR] urls[7] = file:/Users/wangguoqiang/.m2/repository/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar
[ERROR] urls[8] = file:/Users/wangguoqiang/.m2/repository/com/github/kevinstern/software-and-algorithms/1.0/software-and-algorithms-1.0.jar
[ERROR] urls[9] = file:/Users/wangguoqiang/.m2/repository/com/github/stephenc/jcip/jcip-annotations/1.0-1/jcip-annotations-1.0-1.jar
[ERROR] urls[10] = file:/Users/wangguoqiang/.m2/repository/org/pcollections/pcollections/2.1.2/pcollections-2.1.2.jar
[ERROR] urls[11] = file:/Users/wangguoqiang/.m2/repository/com/google/guava/guava/23.5-jre/guava-23.5-jre.jar
[ERROR] urls[12] = file:/Users/wangguoqiang/.m2/repository/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar
[ERROR] urls[13] = file:/Users/wangguoqiang/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
[ERROR] urls[14] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
[ERROR] urls[15] = file:/Users/wangguoqiang/.m2/repository/com/google/auto/auto-common/0.10/auto-common-0.10.jar
[ERROR] urls[16] = file:/Users/wangguoqiang/.m2/repository/com/google/code/findbugs/jFormatString/3.0.0/jFormatString-3.0.0.jar
[ERROR] urls[17] = file:/Users/wangguoqiang/.m2/repository/com/google/code/findbugs/jsr305/3.0.0/jsr305-3.0.0.jar
[ERROR] urls[18] = file:/Users/wangguoqiang/.m2/repository/org/checkerframework/dataflow/2.5.0/dataflow-2.5.0.jar
[ERROR] urls[19] = file:/Users/wangguoqiang/.m2/repository/org/checkerframework/javacutil/2.5.0/javacutil-2.5.0.jar
[ERROR] urls[20] = file:/Users/wangguoqiang/.m2/repository/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar
[ERROR] urls[21] = file:/Users/wangguoqiang/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1.jar
[ERROR] urls[22] = file:/Users/wangguoqiang/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[23] = file:/Users/wangguoqiang/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[24] = file:/Users/wangguoqiang/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[25] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[26] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar
[ERROR] urls[27] = file:/Users/wangguoqiang/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[28] = file:/Users/wangguoqiang/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[29] = file:/Users/wangguoqiang/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar
[ERROR] urls[30] = file:/Users/wangguoqiang/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
[ERROR] urls[31] = file:/Users/wangguoqiang/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
[ERROR] urls[32] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-java/0.9.2/plexus-java-0.9.2.jar
[ERROR] urls[33] = file:/Users/wangguoqiang/.m2/repository/org/ow2/asm/asm/6.0_BETA/asm-6.0_BETA.jar
[ERROR] urls[34] = file:/Users/wangguoqiang/.m2/repository/com/thoughtworks/qdox/qdox/2.0-M7/qdox-2.0-M7.jar
[ERROR] urls[35] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.8.2/plexus-compiler-api-2.8.2.jar
[ERROR] urls[36] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.8.2/plexus-compiler-manager-2.8.2.jar
[ERROR] urls[37] = file:/Users/wangguoqiang/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.8.2/plexus-compiler-javac-2.8.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.codehaus.plexus.languages.java.jpms.LocationManager
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :okhttp

关键位置:

问题出在maven-compiler-plugin这个插件上,好吧,找这个插件的最新版本是3.8.0,然后在pom.xml文件中设入,还是不行,报另一个错误:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project okhttp: Fatal error compiling: CompilerException: InvocationTargetException: com/google/common/collect/ImmutableSet: com.google.common.collect.ImmutableSet -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :okhttp

说明3.8.0的插件和该项目兼容还是有问题。在解决该问题的过程中,发现对maven项目构建过程不熟悉,导致解决问题非常缓慢,如此,抽时间研究下吧。(解决方案后面有讲到)

maven项目构建最关键的文件为pom.xml,从项目根部,构建工具找到第一个pom.xml文件,下面是okhttp的根pom.xml




  4.0.0

  
    org.sonatype.oss
    oss-parent
    7
  

  com.squareup.okhttp3
  parent
  3.12.0-SNAPSHOT
  pom

  OkHttp (Parent)
  An HTTP+HTTP/2 client for Android and Java applications
  https://github.com/square/okhttp

  
    okhttp
    okhttp-tests

    okhttp-android-support

    okhttp-apache
    okhttp-sse
    okhttp-testing-support
    okhttp-tls
    okhttp-urlconnection

    okhttp-logging-interceptor

    okhttp-dnsoverhttps

    okcurl
    mockwebserver
    samples
    benchmarks
  

  
    UTF-8

    
    0.7
    
    7.1.2.v20141202
    4.1.1.4
    1.15
    4.2.6
    1.60
    16.0
    1.7
    1.1.0
    0.19
    1.15.0
    1.1.4

    
    4.12

    
    platform
  

  
    https://github.com/square/okhttp/
    scm:git:https://github.com/square/okhttp.git
    scm:git:[email protected]:square/okhttp.git
    HEAD
  

  
    GitHub Issues
    https://github.com/square/okhttp/issues
  

  
    
      Apache 2.0
      http://www.apache.org/licenses/LICENSE-2.0.txt
    
  

  
    
      
        com.squareup.okio
        okio
        ${okio.version}
      
      
        com.google.code.findbugs
        jsr305
        3.0.2
        provided
      
      
        junit
        junit
        ${junit.version}
      
      
        org.bouncycastle
        bcprov-jdk15on
        ${bouncycastle.version}
      
      
        org.apache.httpcomponents
        httpclient
        ${apache.http.version}
      
      
        io.airlift
        airline
        ${airlift.version}
      
      
        com.google.guava
        guava
        ${guava.version}
      
      
        com.google.android
        android
        ${android.version}
      
      
        com.squareup.moshi
        moshi
        ${moshi.version}
      
      
        com.github.jnr
        jnr-unixsocket
        ${jnr-unixsocket.version}
      
      
        org.conscrypt
        conscrypt-openjdk-uber
        ${conscrypt.version}
      
    
  

  
    
      
        
        
          org.apache.maven.plugins
          maven-compiler-plugin
          3.6.1
          
            javac-with-errorprone
            true
            ${java.version}
            ${java.version}
          
          
            
              org.codehaus.plexus
              plexus-compiler-javac-errorprone
              2.8.1
            
            
              com.google.errorprone
              error_prone_core
              2.0.16
            
          
        

        
          org.apache.maven.plugins
          maven-surefire-plugin
          2.21.0
          
            
              ${okhttp.platform}
            
            true
            
              
              
                listener
                okhttp3.testing.InstallUncaughtExceptionHandlerListener
              
            
          
          
            
              org.apache.maven.surefire
              surefire-junit47
              2.21.0
            
          
        

        
          org.apache.maven.plugins
          maven-javadoc-plugin
          2.10.4
        
      
    

    
      
        org.apache.maven.plugins
        maven-release-plugin
        2.4.2
        
          
            org.apache.maven.scm
            maven-scm-provider-gitexe
            1.9
          
        
        
          true
        
      

      
        org.apache.maven.plugins
        maven-checkstyle-plugin
        2.17
        
          
            com.puppycrawl.tools
            checkstyle
            7.7
          
        
        
          true
          checkstyle.xml
          true
          **/CipherSuite.java
        
        
          
            verify
            
              checkstyle
            
          
        
      
      
        org.codehaus.mojo
        animal-sniffer-maven-plugin
        ${animal.sniffer.version}
        
          
            test
            
              check
            
          
        
        
          
            org.codehaus.mojo.signature
            java16
            1.1
          
        
      
    
  

  
    
      alpn-when-jdk7
      
        1.7
      
      
        
          ${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.jdk7.version}/alpn-boot-${alpn.jdk7.version}.jar
        
        jdk-with-jetty-boot
      
      
        
          
            
              org.apache.maven.plugins
              maven-surefire-plugin
              
                -Xbootclasspath/p:${bootclasspathPrefix} -Xms512m -Xmx512m
              
              
                
                  org.mortbay.jetty.alpn
                  alpn-boot
                  ${alpn.jdk7.version}
                
              
            
          
        
      
    
    
      alpn-when-jdk8
      
        1.8
      
      
        
          ${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.jdk8.version}/alpn-boot-${alpn.jdk8.version}.jar
        
        jdk-with-jetty-boot
      
      
        
          
            
              org.apache.maven.plugins
              maven-surefire-plugin
              
                -Xbootclasspath/p:${bootclasspathPrefix} -Xms512m -Xmx512m
              
              
                
                  org.mortbay.jetty.alpn
                  alpn-boot
                  ${alpn.jdk8.version}
                
              
            
          
        
      
    
    
      jdk9
      
        9
      
      
        jdk9
      
    
    
      conscrypt
      
        conscrypt
      
      
        
          org.conscrypt
          conscrypt-openjdk-uber
        
      
    
    
    
    
    
      alpn-when-jdk8_05
      
        1.8.0_05
      
      
        8.1.0.v20141016
      
    
    
      alpn-when-jdk8_11
      
        1.8.0_11
      
      
        8.1.0.v20141016
      
    
    
      alpn-when-jdk8_20
      
        1.8.0_20
      
      
        8.1.0.v20141016
      
    
    
      alpn-when-jdk8_25
      
        1.8.0_25
      
      
        8.1.2.v20141202
      
    
    
      alpn-when-jdk8_31
      
        1.8.0_31
      
      
        8.1.3.v20150130
      
    
    
      alpn-when-jdk8_40
      
        1.8.0_40
      
      
        8.1.3.v20150130
      
    
    
      alpn-when-jdk8_45
      
        1.8.0_45
      
      
        8.1.3.v20150130
      
    
    
      alpn-when-jdk8_51
      
        1.8.0_51
      
      
        8.1.4.v20150727
      
    
    
      alpn-when-jdk8_60
      
        1.8.0_60
      
      
        8.1.5.v20150921
      
    
    
      alpn-when-jdk8_65
      
        1.8.0_65
      
      
        8.1.6.v20151105
      
    
    
      alpn-when-jdk8_66
      
        1.8.0_66
      
      
        8.1.6.v20151105
      
    
    
      alpn-when-jdk8_71
      
        1.8.0_71
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_72
      
        1.8.0_72
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_73
      
        1.8.0_73
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_74
      
        1.8.0_74
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_77
      
        1.8.0_77
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_91
      
        1.8.0_91
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_92
      
        1.8.0_92
      
      
        8.1.8.v20160420
      
    
    
      alpn-when-jdk8_101
      
        1.8.0_101
      
      
        8.1.8.v20160420
      
    
    
      alpn-when-jdk8_102
      
        1.8.0_102
      
      
        8.1.9.v20160720
      
    
    
      alpn-when-jdk8_111
      
        1.8.0_111
      
      
        8.1.9.v20160720
      
    
    
      alpn-when-jdk8_112
      
        1.8.0_112
      
      
        8.1.9.v20160720
      
    
    
      alpn-when-jdk8_121
      
        1.8.0_121
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_131
      
        1.8.0_131
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_141
      
        1.8.0_141
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_144
      
        1.8.0_144
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_151
      
        1.8.0_151
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_152
      
        1.8.0_152
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_161
      
        1.8.0_161
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_162
      
        1.8.0_162
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_171
      
        1.8.0_171
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_172
      
        1.8.0_172
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_181
      
        1.8.0_181
      
      
        8.1.12.v20180117
      
    
  

文件还是挺长的,但内容并不是很多,下面来分析下:

第一部分:

project:所有项目相关的均在此标签中

maven头:是声明maven的版本等信息,目前基本不会再变


  4.0.0

第二部分:

表示继承关系,即该pom.xml的父xml文件是什么,了解gradle的同学可以把它想成compile或api,通过parent关键字组织整个项目的依赖关系,上面这个文件的parent指向了一个maven中央仓库,用于代码提交

继承关系的下方为该工程的唯一标识,通过groupId、artifactId、version定义

  
    org.sonatype.oss
    oss-parent
    7
  

  com.squareup.okhttp3
  parent
  3.12.0-SNAPSHOT
  pom

对比看一下okhttp路径下的pom.xml文件中的该标签:

okhttp源码导入及Maven构建文件pom.xml的格式_第1张图片

   
  
    com.squareup.okhttp3
    parent
    3.12.0-SNAPSHOT
  

由上面代码可以看出okhttp路径下的文件的parent所映射的刚好为parent(项目根路径)下的pom.xml中的工程定义。

第三部分:maven文档所用到的信息:名称、描述、项目主页的url

  OkHttp (Parent)
  An HTTP+HTTP/2 client for Android and Java applications
  https://github.com/square/okhttp

第四部分:项目所有的子模块

  
    okhttp
    okhttp-tests

    okhttp-android-support

    okhttp-apache
    okhttp-sse
    okhttp-testing-support
    okhttp-tls
    okhttp-urlconnection

    okhttp-logging-interceptor

    okhttp-dnsoverhttps

    okcurl
    mockwebserver
    samples
    benchmarks
  

映射下图中红框中的部分,模块为项目的组织单元,每一个独立的模块代表着项目的中的一个独立业务,在gradle中也如此划分。

okhttp源码导入及Maven构建文件pom.xml的格式_第2张图片

第五部分:自定义属性,可以定义一些文档中用的变量及值存放于此,在文档的其他位置通过变量名进行索引

  
    UTF-8

    
    0.7
    
    7.1.2.v20141202
    4.1.1.4
    1.15
    4.2.6
    1.60
    16.0
    1.7
    1.1.0
    0.19
    1.15.0
    1.1.4

    
    4.12

    
    platform
  

以airlift.version变量为列,使用的位置位于:

第六部分:SCM拉取代码或部署代码的设定,SCM用于项目中从服务器获取代码,或发布代码到服务器,定义了服务器的位置,同步的协议(本项目中为git),版本tag为HEAD(即最新的代码)

  
    https://github.com/square/okhttp/
    scm:git:https://github.com/square/okhttp.git
    scm:git:[email protected]:square/okhttp.git
    HEAD
  

第七部分:问题的报告及跟踪位置

  
    GitHub Issues
    https://github.com/square/okhttp/issues
  

第八部分:软件证书定义

  
    
      Apache 2.0
      http://www.apache.org/licenses/LICENSE-2.0.txt
    
  

第九部分:项目所依赖的工程或模块,这部分较为重要,没有这些依赖关程,项目构建过程中会提示有类文件或定义找不到位置

  
    
      
        com.squareup.okio
        okio
        ${okio.version}
      
      
        com.google.code.findbugs
        jsr305
        3.0.2
        provided
      
      
        junit
        junit
        ${junit.version}
      
      
        org.bouncycastle
        bcprov-jdk15on
        ${bouncycastle.version}
      
      
        org.apache.httpcomponents
        httpclient
        ${apache.http.version}
      
      
        io.airlift
        airline
        ${airlift.version}
      
      
        com.google.guava
        guava
        ${guava.version}
      
      
        com.google.android
        android
        ${android.version}
      
      
        com.squareup.moshi
        moshi
        ${moshi.version}
      
      
        com.github.jnr
        jnr-unixsocket
        ${jnr-unixsocket.version}
      
      
        org.conscrypt
        conscrypt-openjdk-uber
        ${conscrypt.version}
      
    
  

在上面的标签中,各标签含义从标签名中即可获知,注意下scope这个属性,表示依赖范围,默认为compile即编译期,其他可能的值包括:

compile 默认范围,用于编译  

provided 类似于编译,但支持你期待jdk或者容器提供,类似于classpath     

runtime 在执行时需要使用     

test 用于test任务时使用     

system 需要外在提供相应的元素。通过systemPath来取得     

systemPath 仅用于范围为system。提供相应的路径     

optional 当项目自身被依赖时,标注依赖是否传递。用于连续依赖时使用

第十部分:build及插件,这一部分是maven构建的核心,所有编译期的动作都要向build中注册,而所有注册到的动作,会在编译期执行


    
      
        
        
          org.apache.maven.plugins
          maven-compiler-plugin
          3.6.1
          
            javac-with-errorprone
            true
            ${java.version}
            ${java.version}
          
          
            
              org.codehaus.plexus
              plexus-compiler-javac-errorprone
              2.8.1
            
            
              com.google.errorprone
              error_prone_core
              2.0.16
            
          
        

        
          org.apache.maven.plugins
          maven-surefire-plugin
          2.21.0
          
            
              ${okhttp.platform}
            
            true
            
              
              
                listener
                okhttp3.testing.InstallUncaughtExceptionHandlerListener
              
            
          
          
            
              org.apache.maven.surefire
              surefire-junit47
              2.21.0
            
          
        

        
          org.apache.maven.plugins
          maven-javadoc-plugin
          2.10.4
        
      
    

    
      
        org.apache.maven.plugins
        maven-release-plugin
        2.4.2
        
          
            org.apache.maven.scm
            maven-scm-provider-gitexe
            1.9
          
        
        
          true
        
      

      
        org.apache.maven.plugins
        maven-checkstyle-plugin
        2.17
        
          
            com.puppycrawl.tools
            checkstyle
            7.7
          
        
        
          true
          checkstyle.xml
          true
          **/CipherSuite.java
        
        
          
            verify
            
              checkstyle
            
          
        
      
      
        org.codehaus.mojo
        animal-sniffer-maven-plugin
        ${animal.sniffer.version}
        
          
            test
            
              check
            
          
        
        
          
            org.codehaus.mojo.signature
            java16
            1.1
          
        
      
    
  

build由多个插件组成,各个插件又含有自身的设定,以下述插件为例:

        
          
          org.apache.maven.plugins
          maven-compiler-plugin
          3.6.1
          
          
            javac-with-errorprone
            true
            ${java.version}
            ${java.version}
          
          
          
            
              org.codehaus.plexus
              plexus-compiler-javac-errorprone
              2.8.1
            
            
              com.google.errorprone
              error_prone_core
              2.0.16
            
          
        

各插件的功能及配置项可以查看官方文档:

http://maven.apache.org/plugins/index.html

第十一部分:也是parent/pom.xml的最后一部分,profiles部分

  
    
      alpn-when-jdk7
      
        1.7
      
      
        
          ${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.jdk7.version}/alpn-boot-${alpn.jdk7.version}.jar
        
        jdk-with-jetty-boot
      
      
        
          
            
              org.apache.maven.plugins
              maven-surefire-plugin
              
                -Xbootclasspath/p:${bootclasspathPrefix} -Xms512m -Xmx512m
              
              
                
                  org.mortbay.jetty.alpn
                  alpn-boot
                  ${alpn.jdk7.version}
                
              
            
          
        
      
    
    
      alpn-when-jdk8
      
        1.8
      
      
        
          ${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.jdk8.version}/alpn-boot-${alpn.jdk8.version}.jar
        
        jdk-with-jetty-boot
      
      
        
          
            
              org.apache.maven.plugins
              maven-surefire-plugin
              
                -Xbootclasspath/p:${bootclasspathPrefix} -Xms512m -Xmx512m
              
              
                
                  org.mortbay.jetty.alpn
                  alpn-boot
                  ${alpn.jdk8.version}
                
              
            
          
        
      
    
    
      jdk9
      
        9
      
      
        jdk9
      
    
    
      conscrypt
      
        conscrypt
      
      
        
          org.conscrypt
          conscrypt-openjdk-uber
        
      
    
    
    
    
    
      alpn-when-jdk8_05
      
        1.8.0_05
      
      
        8.1.0.v20141016
      
    
    
      alpn-when-jdk8_11
      
        1.8.0_11
      
      
        8.1.0.v20141016
      
    
    
      alpn-when-jdk8_20
      
        1.8.0_20
      
      
        8.1.0.v20141016
      
    
    
      alpn-when-jdk8_25
      
        1.8.0_25
      
      
        8.1.2.v20141202
      
    
    
      alpn-when-jdk8_31
      
        1.8.0_31
      
      
        8.1.3.v20150130
      
    
    
      alpn-when-jdk8_40
      
        1.8.0_40
      
      
        8.1.3.v20150130
      
    
    
      alpn-when-jdk8_45
      
        1.8.0_45
      
      
        8.1.3.v20150130
      
    
    
      alpn-when-jdk8_51
      
        1.8.0_51
      
      
        8.1.4.v20150727
      
    
    
      alpn-when-jdk8_60
      
        1.8.0_60
      
      
        8.1.5.v20150921
      
    
    
      alpn-when-jdk8_65
      
        1.8.0_65
      
      
        8.1.6.v20151105
      
    
    
      alpn-when-jdk8_66
      
        1.8.0_66
      
      
        8.1.6.v20151105
      
    
    
      alpn-when-jdk8_71
      
        1.8.0_71
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_72
      
        1.8.0_72
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_73
      
        1.8.0_73
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_74
      
        1.8.0_74
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_77
      
        1.8.0_77
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_91
      
        1.8.0_91
      
      
        8.1.7.v20160121
      
    
    
      alpn-when-jdk8_92
      
        1.8.0_92
      
      
        8.1.8.v20160420
      
    
    
      alpn-when-jdk8_101
      
        1.8.0_101
      
      
        8.1.8.v20160420
      
    
    
      alpn-when-jdk8_102
      
        1.8.0_102
      
      
        8.1.9.v20160720
      
    
    
      alpn-when-jdk8_111
      
        1.8.0_111
      
      
        8.1.9.v20160720
      
    
    
      alpn-when-jdk8_112
      
        1.8.0_112
      
      
        8.1.9.v20160720
      
    
    
      alpn-when-jdk8_121
      
        1.8.0_121
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_131
      
        1.8.0_131
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_141
      
        1.8.0_141
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_144
      
        1.8.0_144
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_151
      
        1.8.0_151
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_152
      
        1.8.0_152
      
      
        8.1.11.v20170118
      
    
    
      alpn-when-jdk8_161
      
        1.8.0_161
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_162
      
        1.8.0_162
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_171
      
        1.8.0_171
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_172
      
        1.8.0_172
      
      
        8.1.12.v20180117
      
    
    
      alpn-when-jdk8_181
      
        1.8.0_181
      
      
        8.1.12.v20180117
      
    
  

根据环境变量或者是命令所携带的参数信息,区分使用某个构建项,什么意思呢,就是在这里面含有许多的构建项,或者是build子项,或者是变量定义,使用那个项,取决于环境变量及输入命令,区分的标识为activation标签,以下述代码为例:

    
      
      alpn-when-jdk7
      
      
        1.7
      
      
      
        
          ${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.jdk7.version}/alpn-boot-${alpn.jdk7.version}.jar
        
        jdk-with-jetty-boot
      
      
      
        
          
            
              org.apache.maven.plugins
              maven-surefire-plugin
              
                -Xbootclasspath/p:${bootclasspathPrefix} -Xms512m -Xmx512m
              
              
                
                  org.mortbay.jetty.alpn
                  alpn-boot
                  ${alpn.jdk7.version}
                
              
            
          
        
      
    

再来看一下:

    
      alpn-when-jdk8_05
      
        1.8.0_05
      
      
      
        8.1.0.v20141016
      
    

弄清楚了pom.xml的配置项含义,再来解决下之前的问题,从报错信息可以看出,3.8.0的maven-compiler-plugin插件有问题,考虑到okhttp配置的更新时间较早,降一下该插件版本,更换为该插件的3.6.1版本,继续编译,得到如下信息:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] OkHttp (Parent)                                                    [pom]
[INFO] OkHttp                                                             [jar]
[INFO] OkHttp test support classes                                        [jar]
[INFO] OkHttp Transport Layer Security (TLS)                              [jar]
[INFO] MockWebServer                                                      [jar]
[INFO] OkHttp URLConnection                                               [jar]
[INFO] OkHttp Logging Interceptor                                         [jar]
[INFO] OkHttp Tests                                                       [jar]
[INFO] OkHttp Android Platform Support                                    [jar]
[INFO] OkHttp Apache HttpClient                                           [jar]
[INFO] OkHttp Server-Sent Events                                          [jar]
[INFO] OkHttp DNS over HTTPS                                              [jar]
[INFO] OkCurl                                                             [jar]
[INFO] Samples (Parent)                                                   [pom]
[INFO] Sample: Guide                                                      [jar]
[INFO] Sample: Crawler                                                    [jar]
[INFO] Sample: Simple Client                                              [jar]
[INFO] Sample: Slack                                                      [jar]
[INFO] Sample: Static Server                                              [jar]
[INFO] Sample: UNIX domain sockets                                        [jar]
[INFO] Benchmarks                                                         [jar]
[INFO] 
[INFO] --------------------< com.squareup.okhttp3:parent >---------------------
[INFO] Building OkHttp (Parent) 3.12.0-SNAPSHOT                          [1/21]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ parent ---
[INFO] 
[INFO] --- animal-sniffer-maven-plugin:1.15:check (default) @ parent ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.17:checkstyle (default) @ parent ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ parent ---
[INFO] Installing /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/pom.xml to /Users/wangguoqiang/.m2/repository/com/squareup/okhttp3/parent/3.12.0-SNAPSHOT/parent-3.12.0-SNAPSHOT.pom
[INFO] 
[INFO] --------------------< com.squareup.okhttp3:okhttp >---------------------
[INFO] Building OkHttp 3.12.0-SNAPSHOT                                   [2/21]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ okhttp ---
[INFO] 
[INFO] --- templating-maven-plugin:1.0-alpha-3:filter-sources (default) @ okhttp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Source directory: /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/target/generated-sources/java-templates added.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ okhttp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ okhttp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 101 source files to /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/target/classes
注: /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/src/main/java/okhttp3/OkHttpClient.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ okhttp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ okhttp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ okhttp ---
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit47/2.21.0/surefire-junit47-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit47/2.21.0/surefire-junit47-2.21.0.pom (6.4 kB at 3.6 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.21.0/surefire-providers-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.21.0/surefire-providers-2.21.0.pom (2.5 kB at 4.0 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit48/2.21.0/common-junit48-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit48/2.21.0/common-junit48-2.21.0.pom (3.3 kB at 7.9 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit4/2.21.0/common-junit4-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit4/2.21.0/common-junit4-2.21.0.pom (2.2 kB at 3.8 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit3/2.21.0/common-junit3-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit3/2.21.0/common-junit3-2.21.0.pom (1.6 kB at 3.8 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.21.0/surefire-api-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.21.0/surefire-api-2.21.0.pom (3.5 kB at 5.3 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-logger-api/2.21.0/surefire-logger-api-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-logger-api/2.21.0/surefire-logger-api-2.21.0.pom (2.0 kB at 2.1 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/2.21.0/common-java5-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/2.21.0/common-java5-2.21.0.pom (2.7 kB at 2.7 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.9/maven-shared-utils-0.9.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.9/maven-shared-utils-0.9.pom (6.2 kB at 10 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/21/maven-shared-components-21.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/21/maven-shared-components-21.pom (5.1 kB at 6.2 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/25/maven-parent-25.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/25/maven-parent-25.pom (37 kB at 21 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/apache/15/apache-15.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/apache/15/apache-15.pom (15 kB at 18 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.21.0/surefire-grouper-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.21.0/surefire-grouper-2.21.0.pom (2.7 kB at 2.6 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.21.0/maven-surefire-common-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.21.0/maven-surefire-common-2.21.0.pom (11 kB at 14 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.5/maven-plugin-annotations-3.5.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.5/maven-plugin-annotations-3.5.pom (1.7 kB at 1.7 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.5/maven-plugin-tools-3.5.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.5/maven-plugin-tools-3.5.pom (16 kB at 16 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.21.0/surefire-booter-2.21.0.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.21.0/surefire-booter-2.21.0.pom (7.4 kB at 8.5 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.3/plexus-java-0.9.3.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.3/plexus-java-0.9.3.pom (2.4 kB at 3.6 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-languages/0.9.3/plexus-languages-0.9.3.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-languages/0.9.3/plexus-languages-0.9.3.pom (2.2 kB at 2.0 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit47/2.21.0/surefire-junit47-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-junit47/2.21.0/surefire-junit47-2.21.0.jar (167 kB at 55 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit48/2.21.0/common-junit48-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit48/2.21.0/common-junit48-2.21.0.jar (22 kB at 53 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit4/2.21.0/common-junit4-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit4/2.21.0/common-junit4-2.21.0.jar (28 kB at 42 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit3/2.21.0/common-junit3-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit3/2.21.0/common-junit3-2.21.0.jar (12 kB at 19 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/2.21.0/common-java5-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/2.21.0/common-java5-2.21.0.jar (51 kB at 68 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.9/maven-shared-utils-0.9.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/0.9/maven-shared-utils-0.9.jar (172 kB at 128 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.21.0/surefire-grouper-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.21.0/surefire-grouper-2.21.0.jar (40 kB at 51 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.21.0/surefire-api-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.21.0/surefire-api-2.21.0.jar (185 kB at 127 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-logger-api/2.21.0/surefire-logger-api-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-logger-api/2.21.0/surefire-logger-api-2.21.0.jar (13 kB at 3.5 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.21.0/maven-surefire-common-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.21.0/maven-surefire-common-2.21.0.jar (521 kB at 52 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.5/maven-plugin-annotations-3.5.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.5/maven-plugin-annotations-3.5.jar (14 kB at 20 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.21.0/surefire-booter-2.21.0.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.21.0/surefire-booter-2.21.0.jar (273 kB at 234 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.jar (228 kB at 219 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.3/plexus-java-0.9.3.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-java/0.9.3/plexus-java-0.9.3.jar (32 kB at 69 kB/s)
[INFO] 
[INFO] --- animal-sniffer-maven-plugin:1.15:check (default) @ okhttp ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO] 
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ okhttp ---
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.1.1/maven-archiver-3.1.1.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.1.1/maven-archiver-3.1.1.pom (4.3 kB at 3.9 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.1/maven-shared-utils-3.0.1.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.1/maven-shared-utils-3.0.1.pom (4.6 kB at 9.2 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom (10 kB at 13 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/25/commons-parent-25.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/25/commons-parent-25.pom (48 kB at 46 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/3.3/plexus-archiver-3.3.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/3.3/plexus-archiver-3.3.pom (5.3 kB at 7.4 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.pom (4.1 kB at 5.7 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/2.7.1/plexus-io-2.7.1.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/2.7.1/plexus-io-2.7.1.pom (4.9 kB at 7.5 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.11/commons-compress-1.11.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.11/commons-compress-1.11.pom (13 kB at 16 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.pom (15 kB at 18 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/tukaani/xz/1.5/xz-1.5.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/tukaani/xz/1.5/xz-1.5.pom (1.9 kB at 2.4 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.pom (1.5 kB at 2.1 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/3.4/plexus-archiver-3.4.pom
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/3.4/plexus-archiver-3.4.pom (5.3 kB at 7.5 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.1.1/maven-archiver-3.1.1.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/maven-archiver/3.1.1/maven-archiver-3.1.1.jar (24 kB at 28 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.1/maven-shared-utils-3.0.1.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.1/maven-shared-utils-3.0.1.jar (154 kB at 74 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/3.4/plexus-archiver-3.4.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-archiver/3.4/plexus-archiver-3.4.jar (187 kB at 149 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/2.7.1/plexus-io-2.7.1.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-io/2.7.1/plexus-io-2.7.1.jar (86 kB at 81 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.11/commons-compress-1.11.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.11/commons-compress-1.11.jar (426 kB at 314 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/iq80/snappy/snappy/0.4/snappy-0.4.jar (58 kB at 147 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/tukaani/xz/1.5/xz-1.5.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/tukaani/xz/1.5/xz-1.5.jar (100 kB at 152 kB/s)
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar (247 kB at 236 kB/s)
[INFO] Building jar: /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/target/okhttp-3.12.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.17:checkstyle (default) @ okhttp ---
[INFO] Starting audit...
Audit done.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ okhttp ---
[INFO] Installing /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/target/okhttp-3.12.0-SNAPSHOT.jar to /Users/wangguoqiang/.m2/repository/com/squareup/okhttp3/okhttp/3.12.0-SNAPSHOT/okhttp-3.12.0-SNAPSHOT.jar
[INFO] Installing /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp/pom.xml to /Users/wangguoqiang/.m2/repository/com/squareup/okhttp3/okhttp/3.12.0-SNAPSHOT/okhttp-3.12.0-SNAPSHOT.pom
[INFO] 
[INFO] ------------< com.squareup.okhttp3:okhttp-testing-support >-------------
[INFO] Building OkHttp test support classes 3.12.0-SNAPSHOT              [3/21]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ okhttp-testing-support ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ okhttp-testing-support ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-testing-support/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ okhttp-testing-support ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-testing-support/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ okhttp-testing-support ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-testing-support/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ okhttp-testing-support ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ okhttp-testing-support ---
[INFO] No tests to run.
[INFO] 
[INFO] --- animal-sniffer-maven-plugin:1.15:check (default) @ okhttp-testing-support ---
[INFO] Checking unresolved references to org.codehaus.mojo.signature:java16:1.1
[INFO] 
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ okhttp-testing-support ---
[INFO] Building jar: /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-testing-support/target/okhttp-testing-support-3.12.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-checkstyle-plugin:2.17:checkstyle (default) @ okhttp-testing-support ---
[INFO] Starting audit...
Audit done.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ okhttp-testing-support ---
[INFO] Installing /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-testing-support/target/okhttp-testing-support-3.12.0-SNAPSHOT.jar to /Users/wangguoqiang/.m2/repository/com/squareup/okhttp3/okhttp-testing-support/3.12.0-SNAPSHOT/okhttp-testing-support-3.12.0-SNAPSHOT.jar
[INFO] Installing /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-testing-support/pom.xml to /Users/wangguoqiang/.m2/repository/com/squareup/okhttp3/okhttp-testing-support/3.12.0-SNAPSHOT/okhttp-testing-support-3.12.0-SNAPSHOT.pom
[INFO] 
[INFO] ------------------< com.squareup.okhttp3:okhttp-tls >-------------------
[INFO] Building OkHttp Transport Layer Security (TLS) 3.12.0-SNAPSHOT    [4/21]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ okhttp-tls ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ okhttp-tls ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-tls/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ okhttp-tls ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-tls/target/classes
/Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-tls/src/main/java/okhttp3/tls/HeldCertificate.java:425: 错误: [InsecureCryptoUsage] Insecure usage of a crypto API: the algorithm specification is not a compile-time constant expression.
        KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm, "BC");
                                                                        ^
    (see http://errorprone.info/bugpattern/InsecureCryptoUsage)
注: /Users/wangguoqiang/othercode/openproject/okhttp/okhttp/okhttp-tls/src/main/java/okhttp3/tls/HeldCertificate.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
1 个错误
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] OkHttp (Parent) 3.12.0-SNAPSHOT .................... SUCCESS [  1.629 s]
[INFO] OkHttp ............................................. SUCCESS [01:11 min]
[INFO] OkHttp test support classes ........................ SUCCESS [  0.930 s]
[INFO] OkHttp Transport Layer Security (TLS) .............. FAILURE [  0.386 s]
[INFO] MockWebServer ...................................... SKIPPED
[INFO] OkHttp URLConnection ............................... SKIPPED
[INFO] OkHttp Logging Interceptor ......................... SKIPPED
[INFO] OkHttp Tests ....................................... SKIPPED
[INFO] OkHttp Android Platform Support .................... SKIPPED
[INFO] OkHttp Apache HttpClient ........................... SKIPPED
[INFO] OkHttp Server-Sent Events .......................... SKIPPED
[INFO] OkHttp DNS over HTTPS .............................. SKIPPED
[INFO] OkCurl ............................................. SKIPPED
[INFO] Samples (Parent) ................................... SKIPPED
[INFO] Sample: Guide ...................................... SKIPPED
[INFO] Sample: Crawler .................................... SKIPPED
[INFO] Sample: Simple Client .............................. SKIPPED
[INFO] Sample: Slack ...................................... SKIPPED
[INFO] Sample: Static Server .............................. SKIPPED
[INFO] Sample: UNIX domain sockets ........................ SKIPPED
[INFO] Benchmarks 3.12.0-SNAPSHOT ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:14 min
[INFO] Finished at: 2018-08-28T16:39:09+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project okhttp-tls: Compilation failure -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn  -rf :okhttp-tls

得到如下错误信息:

okhttp源码导入及Maven构建文件pom.xml的格式_第3张图片

终于不是环境的问题,是代码有问题,应该是和旧插件兼容性有问题,根据提示,修改下代码,指定使用常量,修改的含义为,指定使用ECDSA进行公私钥生成

okhttp源码导入及Maven构建文件pom.xml的格式_第4张图片

然后屏掉RSA算法的相关测试:

okhttp源码导入及Maven构建文件pom.xml的格式_第5张图片

重新编译,终于成功了,获得了各个源码所编译得到的jar文件。

 

你可能感兴趣的:(JAVA,项目实战)