我收到以下警告,这似乎是触发后续警告和错误。我一直在谷歌搜索疯狂,但没有找到任何清楚说明我应该做什么来解决这个问题。执行Ant构建时会发生此问题。我正在尝试将项目迁移到Java 7.我已将所有source ='1.6'和target =“1.6”更改为1.7。
我确实找到了这篇相关文章:Forward compatible Java 6 annotation processor and SupportedSourceVersion
这似乎表明我应该自己构建Hibernate注释处理器jar,用1.7编译它。似乎我不应该被要求这样做。有问题的类的最新版本(在hibernate-validator-annotation-processor-5.0.1.Final.jar中)已经用1.6编译。由于所述类中的代码引用SourceVersion.latestSupported(),并且1.6中的代码仅返回RELEASE_6,因此似乎没有通常可用的解决方案。
这是警告:
[javac] warning: Supported source version 'RELEASE_6' from annotation processor 'org.hibernate.validator.ap.ConstraintValidationProcessor' less than -source '1.7'
并且,以下是后续警告/错误。
[javac] warning: No processor claimed any of these annotations: javax.persistence.PersistenceContext,javax.persistence.Column,org.codehaus.jackson.annotate.JsonIgnore,javax.persistence.Id,org.springframework.context.annotation.DependsOn,com.trgr.cobalt.infrastructure.datasource.Bucketed,org.codehaus.jackson.map.annotate.JsonDeserialize,javax.persistence.DiscriminatorColumn,com.trgr.cobalt.dataroom.authorization.secure.Secured,org.hibernate.annotations.GenericGenerator,javax.annotation.Resource,com.trgr.cobalt.infrastructure.spring.domain.DomainField,org.codehaus.jackson.annotate.JsonAutoDetect,javax.persistence.DiscriminatorValue,com.trgr.cobalt.dataroom.datasource.config.core.CoreTransactionMandatory,org.springframework.stereotype.Repository,javax.persistence.GeneratedValue,com.trgr.cobalt.dataroom.datasource.config.core.CoreTransactional,org.hibernate.annotations.Cascade,javax.persistence.Table,javax.persistence.Enumerated,org.hibernate.annotations.FilterDef,javax.persistence.OneToOne,com.trgr.cobalt.dataroom.datasource.config.core.CoreEntity,org.springframework.transaction.annotation.Transactional,com.trgr.cobalt.infrastructure.util.enums.EnumConversion,org.springframework.context.annotation.Configuration,com.trgr.cobalt.infrastructure.spring.domain.UpdatedFields,com.trgr.cobalt.infrastructure.spring.documentation.SampleValue,org.springframework.context.annotation.Bean,org.codehaus.jackson.annotate.JsonProperty,javax.persistence.Basic,org.codehaus.jackson.map.annotate.JsonSerialize,com.trgr.cobalt.infrastructure.spring.validation.Required,com.trgr.cobalt.dataroom.datasource.config.core.CoreTransactionNever,org.springframework.context.annotation.Profile,com.trgr.cobalt.infrastructure.spring.stereotype.Persistor,javax.persistence.Transient,com.trgr.cobalt.infrastructure.spring.validation.NotNull,javax.validation.constraints.Size,javax.persistence.Entity,javax.persistence.PrimaryKeyJoinColumn,org.hibernate.annotations.BatchSize,org.springframework.stereotype.Service,org.springframework.beans.factory.annotation.Value,javax.persistence.Inheritance
[javac] error: warnings found and -Werror specified
TIA!
答案 0 :(得分:0)
注释处理器由此
注释 @SupportedSourceVersion(SourceVersion.RELEASE_7)
显然你的hibernate注释处理器只支持RELEASE_6你必须升级它的版本