JRE 1.6 in Maven repository (public or private)

后端 未结 3 1805
滥情空心
滥情空心 2021-02-04 09:48

is there JRE 1.6 available in some public Maven repository we could proxy in our Nexus?

if not, can somebody please provide a hint on how to deploy JRE to a Maven reposi

3条回答
  •  感动是毒
    2021-02-04 10:05

    here's the solution I found:

    • Zip the JREs (jre-linux32-1.6.0.23.zip and jre-jre-win32-1.6.0.zip in my case).
    • Upload them to your Nexus repository through web UI (or deploy manually with "mvn"), set the artifact parameters: groupid="oracle" artifactid="jre-win32" / "jre-linux32", set the right version and packaging type "zip".
    • modify your pom.xml to download and unzip the dependency during the build (I bound it to "prepare-package" phase).

      
          
              
                  org.apache.maven.plugins
                  maven-dependency-plugin
                  2.4
                  
                      
                          copy
                          prepare-package
                          
                              unpack
                          
                          
                              
                                  
                                      oracle
                                      jre-win32
                                      1.6.0.23
                                      zip
                                      false
                                      ${project.build.directory}/alternateLocation
                                      
                                  
                                  
                                      oracle
                                      jre-linux32
                                      1.6.0.23
                                      zip
                                      false
                                      ${project.build.directory}/alternateLocation
                                      
                                  
                              
                              ${project.build.directory}/wars
                              false
                              true
                          
                      
                  
              
          
      
      

    that's it. The JRE will be downloaded and extracted to target\alternateLocation folder.

    you can use "copy" goal instead of "unpack" if you want to only copy the ZIP files without extracting them.

提交回复
热议问题