cancel
Showing results for 
Search instead for 
Did you mean: 

Dependency issue in SDK 3.0

hiten_rastogi1
Star Contributor
Star Contributor

Hi,

After the release of SDK 3.0 I am trying to port my code to the new SDK in which I am facing dependency issue. While running the code I am getting the following exception. The full stacktrace can be found here .

cannot access org.springframework.context.ApplicationContextAware  class file for org.springframework.context.ApplicationContextAware not found

Though I managed to resolve the issue by commenting out the <scope>test</scope> from the  spring-context dependency or by stating the spring-context dependency in the platform-jar project like below

<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
</dependencies>

but I still want to know why I am getting the exception.

Thanks

Hiten Rastogi

1 ACCEPTED ANSWER

krutik_jayswal
Elite Collaborator
Elite Collaborator

Basically its says that the dependencies are available at compile time , but while we are running the project , maven is unable to find it.The reason behind this is repo POM file have the scope as test,  for spring-context dependency, which mean dependencies will be available only in test scope.

Changing the scope to provided will resolve the issue.

I think its a bug in SDK 3.0.

View answer in original post

1 REPLY 1

krutik_jayswal
Elite Collaborator
Elite Collaborator

Basically its says that the dependencies are available at compile time , but while we are running the project , maven is unable to find it.The reason behind this is repo POM file have the scope as test,  for spring-context dependency, which mean dependencies will be available only in test scope.

Changing the scope to provided will resolve the issue.

I think its a bug in SDK 3.0.