Hello World!

I might be onto something here!

Directory Layout
.
├── pom.xml
└── src
    └── main
        ├── java
        │   └── biz
        │       └── tugay
        │           └── spashe
        │               ├── App.java
        │               ├── Foo.java
        │               ├── FooImpl.java
        │               └── aspect
        │                   └── BarImpl.java
        └── resources
            └── beans.xml

pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/maven-v4_0_0.xsd">
 
    <modelVersion>4.0.0</modelVersion>
 
    <groupId>biz.tugay</groupId>
    <artifactId>spashe</artifactId>
    <packaging>jar</packaging>
 
    <version>1.0-SNAPSHOT</version>
 
    <name>bare-maven-project</name>
    <url>http://www.tugay.biz</url>
 
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.3.12.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>1.8.12</version>
        </dependency>
    </dependencies>
 
    <build>
        <finalName>spashe</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>biz.tugay.spashe.App</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
 
    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>

Foo.java
package biz.tugay.spashe;
 
/**
 * User: Koray Tugay (koray@tugay.biz)
 * Date: 26/10/2017
 */
public interface Foo {
    void foo();
}

FooImpl.java
package biz.tugay.spashe;
 
import org.springframework.stereotype.Component;
 
/**
 * User: Koray Tugay (koray@tugay.biz)
 * Date: 26/10/2017
 */
 
@Component(value = "foo")
public class FooImpl implements Foo {
 
    @Override
    public void foo() {
        System.out.println("FooImpl#foo");
    }
}

BarImpl.java
package biz.tugay.spashe.aspect;
 
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
 
/**
 * User: Koray Tugay (koray@tugay.biz)
 * Date: 29/10/2017
 */
 
@Aspect
public class BarImpl {
 
    @Before("execution(* biz.tugay.spashe.Foo.foo(..))")
    public void bar() {
        System.out.println("Bar!");
    }
}

beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/aop
                           http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">
 
    <aop:aspectj-autoproxy/>
 
    <!-- Aspect -->
    <bean id="bar" class="biz.tugay.spashe.aspect.BarImpl"/>
 
    <!-- Business Logic -->
    <bean id="foo" class="biz.tugay.spashe.FooImpl"/>
</beans>

In Action
MacBook-Pro:spashe koraytugay$ mvn clean install exec:java -q
Oct 29, 2017 9:32:07 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7746fcd6: startup date [Sun Oct 29 09:32:07 CET 2017]; root of context hierarchy
Oct 29, 2017 9:32:07 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [beans.xml]
Bar!
FooImpl#foo

Notes

If I remove the tag:
<aop:aspectj-autoproxy/>
from beans.xml,
Bar!
will not be called!