spring 3.0.5-RELEASE and javaconfig - spring

what is the correct maven dependency for spring 3.0.5-RELEASE and the javaconfig features (#Configuration, #Bean, etc.)?
I tried this:
http://mvnrepository.com/artifact/org.springframework.javaconfig/spring-javaconfig
But I got the error described here:
http://forum.springsource.org/showthread.php?t=74730
That thread seems to imply that javaconfig is bundled with spring 3, but when I remove the explicit spring-javaconfig dependency (1.0.0.m3) it can't find the symbols.
I'm sure I'm missing something simple...

JavaConfig is part of core Spring as of Spring 3.0. So you just need to have a dependency on spring-context.

Related

Spring Boot Dependency only for Dependency Injection Features?

I just started a Compose for Desktop project with Kotlin. So there is no web stuff I am used to. This is why I did not use Spring stuff from the beginning.
However after a while I kind of miss dependency injection ;)
I tried to look for a spring boot / spring framework dependency that only has functionality like #Service, #Component, #Autowired etc. I was not able to find anything. This always was somewhat included into other contexts like Spring-Boot-Web etc.
So my question: Is there a Dependency Injection Only library with spring?

aspectj annotation not working with flink [duplicate]

I am writing Spring 4 application with java config. I can use AOP in this project for all spring component. But i can't use it for a normal POJO class.
what is the library I need to add and what is the configuration I need to put in my config file to get this working
Spring AOP can only be applied to Spring-managed components/beans, not to non-Spring POJOs.
If you want to apply AOP to non-Spring classes you need AspectJ, not a proxy-based "AOP lite" framework like Spring AOP. For more information about how to use AspectJ (which does not need Spring at all) in combination with Spring and how to configure load-time weaving, please read the corresponding part of the Spring manual.

How to discover which spring jar includes a spring package and class?

I am upgrading the libraries on a system and am implementing spring boot. But, there are some dependencies that have to be added over and above the spring boot starters, and some of these are Spring classes.
How can I tell which library a package and class is coming from? The documentation for the class does not seem to provide this...
If i'm understanding correctly, what i do is looking for Compile Dependencies in the maven repos.

Spring vs JAX-RS

Here, several questions have been asked by many developers about difference between Spring-Rest and JAX-RS.
And, I have also learned that Spring is not following any specification and Spring framework has their own implementation then
Why Spring allows all that Annotations which are supported/used by JAX-RS by default?
Spring does not support JAX-RS annotations. If there is a situation where you think they do, then you are mistaken or it's just a coincidence. Period. If you will add any JAX-RS annotations in my Spring MVC program, nothing will happen. Annotations are just metadata. They are not programs. If Spring does not recognize the metadata, it will ignore it. But if you use a JAX-RS annotation in place of a Spring annotation that is used for the same purpose, respective of their framework, then you will not get the expected Spring behavior. So basically, if you are using Spring MVC, remove any JAX-RS dependencies so you don't mistakenly use them.

What Spring annotations can we use in Hybris commerce project?

I was reading about Spring core module and came across Spring annotations that I did not see till now in the Hybris project:
#Component,#Qualifier
Are these used in Hybris projects?
Hybris uses both. Annotation Injection and XML Injection. You can also use both. I recommend you, to define a clear strategy when you use which one.
For example:
Controller - Annotation Injection
Facade - XML Injection
Service - XML Injection
To your point, which kind of Annotation you should use, have a look here:
What's the difference between #Component, #Repository & #Service annotations in Spring?
In common said, there is not really a different. It's just nice to use the correct Annotation for the correct class.
Hybris 6.6 uses Spring 4.3. The usual annotations like #Autowired, #Required, #Controller, and many others should work.
If you have access to Hybris Help, have a look at "Spring Framework in SAP Commerce": https://help.hybris.com/6.6.0/hcd/8c63621986691014a7e0a18695d7d410.html
There is:
Dependency Injection
Interface-Driven Design
Beans (and aliasing)
Spring Profiles
Spring MVC
Spring Integration
etc

Resources