2016-11-07 55 views
0

我已經設置了一個Eclipse Maven項目來使用GitHub存儲庫作爲依賴項。現在我分叉了該存儲庫,將依賴關係切換到fork,並對fork進行了小改動。現在該項目仍然編譯並運行得很好,但Eclipse沒有看到變化,這在GitHub上顯示得很好。這讓我想到:Eclipse沒有看到在Maven項目的GitHub依賴項中所做的更改

如果Eclipse無法看到對GitHub的依賴關係,它應該無法構建項目。另一方面,如果它能夠得到它,但沒有看到變化,那必定意味着新的分支還沒有以某種方式正確地鏈接到項目;最有可能的是舊的回購仍然存在於我的本地機器上,Maven使用它來構建項目,原因是我無法辨別。我嘗試重建並重新導入項目,但沒有幫助。我是Maven新手,所以我真的很迷茫。我需要知道:

這是什麼造成的?我缺少Maven/Eclipse/GitHub的工作方式?我需要下載,更新,刷新或重建什麼文件或列表?

編輯; pom.xml:

<?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.MiroslavMarecek</groupId> 
      <artifactId>eet-client-1</artifactId> 
     </dependency> 
    </dependencies> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>com.github.MiroslavMarecek</groupId> 
       <artifactId>eet-client-1</artifactId> 
       <version>1.2</version> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 
</project> 
+0

你剛剛設置了德未決?你可以顯示'pom.xml'嗎? – Thilo

+0

你真的重建了你的「依賴」嗎?就像'mvn clean install'?如果不是,Maven仍然使用在本地Maven倉庫中緩存的版本。 – lexicore

+0

嘗試'mvn clean install',仍然沒有看到更改。 – Sargon1

回答

0

解決方案:

  1. 發佈的分叉回購

  2. 的新版本在POM改變了版本號新版本

相關問題