1

Maven 経由で Oracle (Sun) Java JDK をダウンロードしようとしましたが、成功しませんでした:

<dependency>
    <groupId>com.sun</groupId>
    <artifactId>jdk</artifactId>
    <version>6u45</version>
    <classifier>dlj-linux-i586</classifier>
    <type>bin</type>
</dependency>

Oracle (Sun) Java JDK をダウンロードするには、どの Maven リポジトリーを使用すればよいですか?

追加した

手動でダウンロードせずに、maven で jdk-6u45-linux-i586.bin JDK インストーラーの DLJ バージョンをダウンロードする方法を見つけたいです。

依存関係が適切に構成されていないか、maven リポジトリが見つからない場合、標準の maven エラーが発生します。

Missing:
----------
com.sun:jdk:bin:dlj-linux-amd64:6u45

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=com.sun -DartifactId=jdk -Dversion=6u45 -Dclassifier=dlj-linux-amd64 -Dpackaging=bin -Dfile=/path/to/file
4

3 に答える 3

3

Linux マシンで実行している場合は、maven-exec-plugin を呼び出して curl/wget を使用して jdk をダウンロードできます。

...
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.2.1</version>
  <executions>
    <!-- using curl -->
    <execution>
      <id>download oracle jdk (curl)</id>
      <phase>process-resources</phase>
      <goals>
        <goal>exec</goal>
      </goals>
      <configuration>
        <executable>curl</executable>
        <arguments>
          <argument>-L</argument>
          <argument>--header</argument>
          <argument>Cookie: s_nr=1359635827494; s_cc=true; gpw_e24=blub; s_sq=[[]]; gpv_p24=novalue</argument>
          <argument>http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin</argument>
          <argumen>-o</argumen>
          <argument>${project.build.directory}/curl-jdk-6u45-linux-i586.bin</argument>
        </arguments>
      </configuration>
    </execution>
    <execution>
      <!-- using wget -->
      <id>download oracle jdk (wget)</id>
      <phase>process-resources</phase>
      <goals>
        <goal>exec</goal>
      </goals>
      <configuration>
        <executable>wget</executable>
        <arguments>
          <argument>--no-cookies</argument>
          <argument>--header</argument>
          <argument>Cookie: s_nr=1359635827494; s_cc=true; gpw_e24=blub; s_sq=[[]]; gpv_p24=no value</argument>
          <argument>http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin</argument>
          <argument>-O</argument>
          <argument>${project.build.directory}/wget-jdk-6u45-linux-x64.bin</argument>
        </arguments>
      </configuration>
    </execution>
  </executions>
</plugin>
...
于 2013-08-06T06:36:57.477 に答える