DATAJPA-494 - Fix template.mf to make sure auditing can be used on OSGi.
template.mf now contains an explicit Import-Package directive to make sure the relevant packages for the auditing functionality can be resolved in an OSGi environment. This hadn't been the case before as we don't explicitly refer to some classes necessary (mostly to prevent class loading errors in IDEs). The explicit declarations make sure the relevant Import-Package declarations are added even if Bundlor doesn't find any types that would explicitly require the imports. JpaAuditingRegistrar now also explicitly hints to the class not being visible in case of auditing setup errors. Original pull request: #62.
This commit is contained in:
committed by
Oliver Gierke
parent
c4b651b6f7
commit
1f6f1df58b
@@ -92,7 +92,8 @@ class JpaAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
|
||||
}
|
||||
|
||||
if (!ClassUtils.isPresent(BEAN_CONFIGURER_ASPECT_CLASS_NAME, getClass().getClassLoader())) {
|
||||
throw new BeanDefinitionStoreException("Could not configure Spring Data JPA auditing-feature because"
|
||||
throw new BeanDefinitionStoreException(BEAN_CONFIGURER_ASPECT_CLASS_NAME + " not found. \n"
|
||||
+ "Could not configure Spring Data JPA auditing-feature because"
|
||||
+ " spring-aspects.jar is not on the classpath!\n"
|
||||
+ "If you want to use auditing please add spring-aspects.jar to the classpath.");
|
||||
}
|
||||
|
||||
@@ -22,4 +22,7 @@ Import-Template:
|
||||
org.springframework.beans.factory.aspectj;version="${spring:[=.=.=.=,+1.1.0)}";resolution:=optional,
|
||||
org.springframework.data.*;version="${springdata.commons:[=.=.=.=,+1.0.0)}",
|
||||
org.w3c.*;version="0.0.0"
|
||||
|
||||
Import-Package: org.aspectj.lang;version="${aspectj:[=.=.=,+1.0.0)}";resolution:=optional,
|
||||
org.aspectj.runtime.reflect;version="${aspectj:[=.=.=,+1.0.0)}";resolution:=optional,
|
||||
org.springframework.beans.factory.aspectj;version="${spring:[=.=.=.=,+1.1.0)}";resolution:=optional
|
||||
|
||||
|
||||
Reference in New Issue
Block a user