Maven存储库中的JRE 1.6(公共或私有) [英] JRE 1.6 in Maven repository (public or private)

查看:105
本文介绍了Maven存储库中的JRE 1.6(公共或私有)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在我们的Nexus中代理一些公共Maven存储库中是否有JRE 1.6?

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

如果没有,有人可以提供一些关于如何将JRE部署到一个Maven存储库?

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

推荐答案

这里是我找到的解决方案:

here's the solution I found:


  • 压缩JRE(jre-linux32-1.6.0.23.zip和jre-jre-win32-1.6.0.zip在
    我的情况下)。

  • 通过Web UI将它们上传到您的Nexus存储库(或使用mvn手动部署),设置工件参数:groupid =oracleartifactid =jre-win32/jre -linux32,设置
    正确的版本和打包类型zip。

  • 修改你的pom.xml以在构建期间下载并解压缩依赖项(我绑定它准备包阶段)。

  • 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).

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <id>copy</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>oracle</groupId>
                                <artifactId>jre-win32</artifactId>
                                <version>1.6.0.23</version>
                                <type>zip</type>
                                <overWrite>false</overWrite>
                                <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
                                <!--<destFileName>optional-new-name.jar</destFileName>-->
                            </artifactItem>
                            <artifactItem>
                                <groupId>oracle</groupId>
                                <artifactId>jre-linux32</artifactId>
                                <version>1.6.0.23</version>
                                <type>zip</type>
                                <overWrite>false</overWrite>
                                <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
                                <!--<destFileName>optional-new-name.jar</destFileName>-->
                            </artifactItem>
                        </artifactItems>
                        <outputDirectory>${project.build.directory}/wars</outputDirectory>
                        <overWriteReleases>false</overWriteReleases>
                        <overWriteSnapshots>true</overWriteSnapshots>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


就是这样。 JRE将被下载并提取到
target \alternateLocation文件夹。

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

如果你想只使用复制目标而不是解包复制ZIP文件而不提取它们。

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

这篇关于Maven存储库中的JRE 1.6(公共或私有)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆