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
here's the solution I found:
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>
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.
Here you can read how to install a jar into a maven repo. But why do you want to install the JRE jars in a maven repo?
Your requirement is somewhat valid use-case. But IMHO, putting it in to a maven-repo is not the way to do it.
Other applications, achieve this requirement by getting the executables directly from the provider. For an example build servers like Hudson/Jenkins need to download Java/Maven upon users selection and AFAIR Jenkins download them directly from the Oracle site. (Since oracle asks you to login before download they use SSO mechanism). A similar solution along those path would be suitable for you.
Even if you host your JRE in m2-repo there are certain security problems. JRE is a sensitive program. Even if you say that you have hosted the same JRE from oracle, I would rather download it from oracle.