2017-08-30 41 views
0

我有我的POM以下依賴性:Dropwizard和intelliJ autocompletes不工作? (使用Maven)

 <dependency> 
      <groupId>io.dropwizard</groupId> 
      <artifactId>dropwizard-bom</artifactId> 
      <version>${dropwizard.version}</version> 
      <type>pom</type> 
      <scope>import</scope> 
     </dependency> 

     <dependency> 
      <groupId>io.dropwizard</groupId> 
      <artifactId>dropwizard-auth</artifactId> 
      <version>${dropwizard.version}</version> 
      <scope>import</scope> 
     </dependency> 

我已經建立了項目,使需要確保一切都在的地方 - 但後來當我寫了下面的代碼:

public class BasicAuthentication implements Authenticator { 
    // I am aware that Authenticator takes arguments, but this is a separate issue. :) 
} 

出於某種原因,當我輸入單詞「Authenticator」 - 該類的自動完成建議是針對java,sun等的 - dropwizard.auth不在那裏。

任何想法是怎麼回事?

我標註的Maven,的IntelliJ和Dropwizard的問題,因爲我是UNAWAY其中這些實際上導致了問題...

編輯:沒有人真正似乎有這一個答案 - 我應該放棄並去一些傳統上爲我工作的東西,比如春天?

回答

1

首先,確保爲Maven項目啓用了「啓用自動導入」,並且該項目庫在項目視圖中的外部庫下可見。

偏好|構建,執行,部署|構建工具| Maven |導入| 自動導入Maven項目。

您也可以在項目視圖中右鍵單擊。

右鍵單擊| Maven |再進口。

如果問題仍然存在,你可以嘗試

文件|使IntelliJ中的緩存/重新啓動選項無效。

+0

嗯,謝謝,但它似乎沒有這些解決我的問題。 – MickeyThreeSheds

+0

@MickeyThreeSheds依賴關係管理標籤下的bom依賴項? <依賴性> io.dropwizard dropwizard-BOM $ {dropwizard.version} POM 進口 請嘗試刪除dropwizard-auth的作用域導入和d驗證在屬性下指定了dropwizard.version。 –

+0

@MickeyThreeSheds做參考[StackOverflow |行家-BOM-帳單的材料依賴性](https://stackoverflow.com/questions/38496022/maven-bom-bill-of-materials-dependency) –