我收到以下警告,这似乎会触发后续警告和错误。我一直在疯狂地搜索,但没有发现任何东西能清楚地表明我应该做什么来解决这个问题。当我执行Ant构建时会出现这个问题。我正在尝试将我们的项目迁移到Java7。我已将所有源="1.6"和目标="1.6"更改为1.7。
我确实找到了这篇相关的文章:前向兼容的Java6注释处理器和SupportedSourceVersion
这似乎表明我应该自己构建Hibernate注释处理器jar,用1.7编译它。似乎不应该要求我这样做。有问题的类的最新版本(在hibernate-validator-annotation-processor-5.01.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!
注释处理器由该进行注释
@SupportedSourceVersion(SourceVersion.RELEASE_7)
显然,您的hibernate注释处理器只支持RELEASE_6,您必须升级它的版本