2012-10-16 84 views
3

我想在IDEA中使用Make project,並且出現編譯錯誤。如何解決這個問題? 我沒有在項目中重複類。當我按Jump to source時,它顯示項目目錄target中的課程。編譯錯誤 - 在IntelliJ IDEA中複製類

duplicate class: com.kmware.ttk.kladr.model.KladrSchemStreet_ 

,並與項目的所有類相同

IDEA 11.1.3 UBUNTU 12.04 JBoss作爲7

附加代碼:

Round 1: 
    input files: {com.kmware.ttk.kladr.model.KladrSchemBaseShortening_, com.kmware.ttk.kladr.model.KladrStreetShortening_, com.kmware.ttk.kladr.model.KladrSchemAltNames_, com.kmware.ttk.kladr.model.KladrSchem_, com.kmware.ttk.kladr.model.RQObject_, com.kmware.ttk.kladr.model.KladrBuilding_, com.kmware.ttk.kladr.model.KladrSettings_, com.kmware.ttk.kladr.model.KladrCity_, com.kmware.ttk.kladr.model.KladrSchemStreet_, com.kmware.ttk.kladr.model.KladrSchemBuilding_, com.kmware.ttk.kladr.model.KladrStreet_, com.kmware.ttk.kladr.dao.KladrUpdateDAO, com.kmware.ttk.kladr.dao.KladrStreetDAO, com.kmware.ttk.kladr.model.RQObject, com.kmware.ttk.kladr.model.KladrSettings, com.kmware.ttk.kladr.model.KladrBuilding, com.kmware.ttk.kladr.model.KladrSchemBaseShortening, com.kmware.ttk.kladr.model.KladrCity, com.kmware.ttk.kladr.model.KladrSchemStreet, com.kmware.ttk.kladr.model.KladrSchemAltNames, com.kmware.ttk.kladr.model.KladrSchem, com.kmware.ttk.kladr.dao.KladrStreetShorteningDAO, com.kmware.ttk.kladr.dao.BasicKladrDAO, com.kmware.ttk.kladr.dao.KladrBuildingDAO, com.kmware.ttk.kladr.dao.helper.LazyModelProperties, com.kmware.ttk.kladr.model.KladrStreet, com.kmware.ttk.kladr.model.KladrSchemBuilding, com.kmware.ttk.kladr.model.KladrStreetShortening} 

    annotations: [javax.annotation.Generated, javax.persistence.metamodel.StaticMetamodel, javax.ejb.Stateless, javax.persistence.PersistenceContext, javax.ejb.TransactionAttribute, org.jboss.ejb3.annotation.TransactionTimeout, javax.persistence.MappedSuperclass, javax.persistence.Id, javax.persistence.Column, javax.persistence.Version, java.lang.Override, javax.persistence.Entity, javax.persistence.Table, javax.persistence.GeneratedValue, javax.persistence.Inheritance, javax.validation.constraints.NotNull, org.hibernate.validator.constraints.NotEmpty, javax.validation.constraints.Digits, java.lang.SuppressWarnings] 

    last round: false 

Note: Hibernate JPA 2 Static-Metamodel Generator 1.2.0.Final 

Processor org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor matches [javax.persistence.Entity, javax.persistence.MappedSuperclass] and returns false. 

Processor org.hibernate.validator.ap.ConstraintValidationProcessor matches [javax.persistence.PersistenceContext, javax.ejb.TransactionAttribute, javax.persistence.Column, javax.validation.constraints.NotNull, javax.persistence.Table, org.jboss.ejb3.annotation.TransactionTimeout, java.lang.Override, javax.persistence.Id, javax.persistence.Version, javax.persistence.MappedSuperclass, org.hibernate.validator.constraints.NotEmpty, javax.ejb.Stateless, javax.persistence.metamodel.StaticMetamodel, javax.persistence.Entity, javax.validation.constraints.Digits, javax.annotation.Generated, java.lang.SuppressWarnings, javax.persistence.Inheritance, javax.persistence.GeneratedValue] and returns false. 

Round 2: 

    input files: {com.kmware.ttk.kladr.model.KladrSchemStreet_, com.kmware.ttk.kladr.model.KladrSchemBuilding_, com.kmware.ttk.kladr.model.KladrSchemAltNames_, com.kmware.ttk.kladr.model.KladrStreet_, com.kmware.ttk.kladr.model.KladrSchemBaseShortening_, com.kmware.ttk.kladr.model.KladrBuilding_, com.kmware.ttk.kladr.model.KladrCity_, com.kmware.ttk.kladr.model.KladrSchem_, com.kmware.ttk.kladr.model.RQObject_, com.kmware.ttk.kladr.model.KladrStreetShortening_, com.kmware.ttk.kladr.model.KladrSettings_} 

    annotations: [] 

Processor org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor matches [] and returns false. 

Processor org.hibernate.validator.ap.ConstraintValidationProcessor matches [] and returns false. 

Round 3: 

    input files: {} 

    last round: true 

Compilation completed with 11 errors and 0 warnings 

11 errors 
0 warnings 

/home/kelevra/java/KLADR/kladr/kladr-ejb/target/classes/com/kmware/ttk/kladr/model/KladrSchemStreet_.java 
duplicate class: com.kmware.ttk.kladr.model.KladrSchemStreet_ 

/home/kelevra/java/KLADR/kladr/kladr-ejb/target/classes/com/kmware/ttk/kladr/model/KladrSchemBuilding_.java 
duplicate class: com.kmware.ttk.kladr.model.KladrSchemBuilding_ 

/home/kelevra/java/KLADR/kladr/kladr-ejb/target/classes/com/kmware/ttk/kladr/model/KladrSchemAltNames_.java 
duplicate class: com.kmware.ttk.kladr.model.KladrSchemAltNames_ 

... 

和8更多類

+0

你可以分享一個小樣本來重現它嗎?你用什麼JDK作爲目標?嘗試使用Oracle JDK而不是OpenJDK。 – CrazyCoder

+0

我正在使用Oracle jdk 1.6。我添加了一些有問題的代碼 –

+0

檢查你沒有多個源相同的類(或符號鏈接)。 – CrazyCoder

回答

1

你不知何故添加了comp你的模塊輸出作爲依賴?直接通過IntelliJ或通過Maven。

+0

是的,我添加了它扔項目結構 –

+0

你不應該編輯在Maven導入的項目中手動創建項目/模塊依賴項,所有依賴項都由Maven自動處理,IDEA在項目導入時配置它們。您的手動更改將在下次重新導入時丟棄。 – CrazyCoder

+0

如何重新導入? –

相關問題