You basic confusion is there are two main packages that define annotations.
org.osgi.service.component.annotations.Component
org.apache.felix.scr.annotations.Component
For example, the @Component annotation used in Maven Archetype 10 was org.apache.felix.scr.annotations.Component
Now the @Component Annotation used in Maven Archetype 11 is org.osgi.service.component.annotations.Component;
There are quite a few significant changes. For example, there is no longer @Service or @SlingServlet annotations in org.osgi.service.component.annotations.
In Maven Arch 10 project - we could defined a servlet like this:
@SlingServlet(paths="/bin/mySearchServlet", methods = "POST", metatype=true)
public class HandleClaim extends org.apache.sling.api.servlets.SlingAllMethodsServlet {
private static final long serialVersionUID = 2598426539166789515L;
In Maven Arch 11 – we define a servlet like this – no @SlingServlet annotation:
@Component(service=Servlet.class,
property={
Constants.SERVICE_DESCRIPTION + "=Simple Demo Servlet",
"sling.servlet.methods=" + HttpConstants.METHOD_POST,
"sling.servlet.paths="+ "/bin/myDataSourcePoolServlet"
})
Read this article written by Feike:
Learn about the Annotations in the org.osgi.service.component.annotations package