2016-11-15 666 views
3

Maven依存関係を現在のものから別のものに変更しようとしています。この他の依存関係は、現在のものが古いバージョンのフォークであるため、ほとんどの場合、現在のものと同じ機能をいくつか変更して保存します。これを行うには、私が持っている:Eclipseので削除して再インポートしたプロジェクト EclipseにMaven依存関係が表示されない

  • maven clean install
  • 新しい依存にポンポンの古い依存関係へのすべての参照を

    1. を変更しますしかし、私はまだ最初と同じ問題に遭遇しています:

      1. Eclipseにはどのクラスもありません依存関係。それはそれらをインポートすることを提供しません。プロジェクトにmvn clean packageをしようとしたら
      2. は、Mavenは、次のエラーメッセージで、ビルドに失敗します。私はタイプミスのためにポンポンと正しさのためのバージョンをチェックした

        [ERROR] Failed to execute goal on project eet-demo-maven: Could not resolve dependencies for project cz.tomasdvorak:eet-demo-maven:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.github.todvorak:eet-client:jar:1.3.2: Failed to read artifact descriptor for com.github.todvorak:eet-client:jar:1.3.2: Could not transfer artifact com.github.todvorak:eet-client:pom:1.3.2 from/to jitpack.io (https://jitpack.io): Not authorized , ReasonPhrase:Repo not found or no access token provided. -> [Help 1]

      を、ので、それらのshouldn」問題である。私はこれが依存関係/依存関係管理/ jitpackとどのように機能するのかと疑問に思っています。私は本当にそれらに触れたことはありません。そこにあるものは、私がプロジェクトのために持っていた開始コードからコピーされているか、Mavenを使って後に振り回された結果であり、私はほぼ完全に初心者です。私はthis質問を見て、そこに解決策を試しましたが、私の場合はそれらのどれも動作しません。

      Mavenに依存性とその推移依存性を再度見せて、プロジェクトを正しくコンパイルする方法を教えてください。

      ポンポン:

      <?xml version="1.0" encoding="UTF-8"?> 
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
          <modelVersion>4.0.0</modelVersion> 
      
          <build> 
           <plugins> 
      
            <plugin> 
             <groupId>org.apache.maven.plugins</groupId> 
             <artifactId>maven-dependency-plugin</artifactId> 
             <version>2.10</version> 
             <executions> 
              <execution> 
               <id>copy-dependencies</id> 
               <phase>package</phase> 
               <goals> 
                <goal>copy-dependencies</goal> 
               </goals> 
               <configuration> 
                <outputDirectory>${project.build.directory}</outputDirectory> 
                <overWriteReleases>false</overWriteReleases> 
                <overWriteSnapshots>false</overWriteSnapshots> 
                <overWriteIfNewer>true</overWriteIfNewer> 
               </configuration> 
              </execution> 
             </executions> 
            </plugin> 
      
            <plugin> 
             <groupId>com.akathist.maven.plugins.launch4j</groupId> 
             <artifactId>launch4j-maven-plugin</artifactId> 
             <executions> 
              <execution> 
               <id>l4j-clui</id> 
               <phase>package</phase> 
               <goals> 
                <goal>launch4j</goal> 
               </goals> 
               <configuration> 
                <dontWrapJar>true</dontWrapJar> 
                <headerType>console</headerType> 
                <jar>eet-demo-maven-1.0-SNAPSHOT.jar</jar> 
                <outfile>target\EETSender.exe</outfile> 
                <errTitle></errTitle> 
                <cmdLine></cmdLine> 
                <chdir>.</chdir> 
                <priority>normal</priority> 
                <downloadUrl>http://java.com/download</downloadUrl> 
                <supportUrl></supportUrl> 
                <stayAlive>true</stayAlive> 
                <restartOnCrash>true</restartOnCrash> 
                <manifest></manifest> 
                <icon></icon> 
                <singleInstance> 
                 <mutexName>EETMutex</mutexName> 
                 <windowTitle></windowTitle> 
                </singleInstance> 
                <classpath> 
                 <mainClass>cz.tomasdvorak.eetdemo.Main</mainClass> 
                </classpath> 
                <jre> 
                 <path></path> 
                 <bundledJre64Bit>false</bundledJre64Bit> 
                 <bundledJreAsFallback>false</bundledJreAsFallback> 
                 <minVersion>1.6.0_1</minVersion> 
                 <maxVersion></maxVersion> 
                 <jdkPreference>preferJre</jdkPreference> 
                 <runtimeBits>64/32</runtimeBits> 
                </jre> 
               </configuration> 
              </execution> 
             </executions> 
            </plugin> 
      
      <plugin> 
          <artifactId>maven-jar-plugin</artifactId> 
          <configuration> 
           <archive> 
            <manifest> 
             <addClasspath>true</addClasspath> 
             <mainClass>cz.tomasdvorak.eetdemo.Main</mainClass> 
            </manifest> 
           </archive> 
           <descriptors> 
            <descriptor>assembly.xml</descriptor> 
           </descriptors> 
          </configuration> 
      </plugin> 
      
      </plugins> 
          </build> 
      
          <groupId>cz.tomasdvorak</groupId> 
          <artifactId>eet-demo-maven</artifactId> 
          <version>1.0-SNAPSHOT</version> 
      
          <repositories> 
           <repository> 
            <id>jitpack.io</id> 
            <url>https://jitpack.io</url> 
           </repository> 
          </repositories> 
      
          <dependencies> 
           <dependency> 
            <groupId>com.github.todvorak</groupId> 
            <artifactId>eet-client</artifactId> 
            </dependency> 
          </dependencies> 
      
          <dependencyManagement> 
           <dependencies> 
            <dependency> 
             <groupId>com.github.todvorak</groupId> 
             <artifactId>eet-client</artifactId> 
             <version>1.3.2</version> 
            </dependency> 
           </dependencies> 
          </dependencyManagement> 
      </project> 
      

      EDIT:The dependency in question on GitHub

      EDIT 2:次のように私はポンポンを変更し、私は明らかに再度プロジェクトをビルドにMavenのの霊をなだめています。 Eclipseでは、以前は見られなかったものをすべてインポートできます。この突然の心の変化についての説明は、彼の疑問に依然として貴重な結論になるだろう。

      <project> 
      . 
      . 
      . 
          <dependencies> 
          <dependency> 
           <groupId>com.github.todvora</groupId> 
           <artifactId>eet-client</artifactId> 
           <version>1.3.2</version> 
          </dependency> 
          </dependencies> 
      <!-- 
          <dependencyManagement> 
           <dependencies> 
            <dependency> 
             <groupId>com.github.todvorak</groupId> 
             <artifactId>eet-client</artifactId> 
             <version>1.3.2</version> 
            </dependency> 
           </dependencies> 
          </dependencyManagement> 
          --> 
      </project> 
      
  • +1

    をtordovaために余分なKを追加し、依存関係をダウンロードすることができないように思えます。おそらく権利のためか、おそらくまだ展開されていないかもしれません。依存関係 'com.github.todvorak:eet-client:jar:1.3.2'を手動でダウンロードできますか? –

    +0

    そうだね。私はそれが何であるか正確には分かりませんが、GitHubの "Clone or download"ボタンを使って取得できます.JitPackボタンの下にあります。 – Sargon1

    +0

    それから、おそらくデプロイされています。あなたの設定を使って手動でファイルをダウンロードしようとします。http://stackoverflow.com/questions/1895492/how-can-i-download-a-specific-maven-artifact-in-それを呼び出す方法についての1つのコマンドライン。それがダウンロードされている場合は、問題はどこか他の場所にありますが、私は疑いがあります。 –

    答えて

    2

    依存関係は次のようになります。

    <dependencies> 
        <dependency> 
         <groupId>com.github.todvora</groupId> 
         <artifactId>eet-client</artifactId> 
    
        </dependency> 
    </dependencies> 
    
    <dependencyManagement> 
        <dependencies> 
         <dependency> 
          <groupId>com.github.todvora</groupId> 
          <artifactId>eet-client</artifactId> 
          <version>1.3.2</version> 
         </dependency> 
        </dependencies> 
    </dependencyManagement> 
    

    あなたは

    +0

    True。何らかの理由で、をダンプして、適切なにバージョンを追加したときに再び動作します。私はオートコンプリートとスペルチェックに多すぎると思う。 JitPackから自動生成されたpom行をコピーして依存関係を追加すると、誤ってエラーが修正されました。 – Sargon1

    関連する問題