Compile time weaving is a technique which allows AOP aspects to be "woven in" at compile time mainly by modifying the compiled code (e.g. byte-code manipulation in Java).
Questions tagged [compile-time-weaving]
89 questions
38
votes
2 answers
@Transactional in super classes not weaved when using load time weaving
The project I am working on has a similar structure for the DAOs to the one bellow:
/**
* Base DAO class
*/
@Transactional
public class JPABase {
@PersistenceContext
private EntityManager entityManager;
public void persist(Object…

Anca N
- 381
- 3
- 5
25
votes
4 answers
Why doesn't AspectJ compile-time weaving of Spring's @Configurable work?
Update 5: I've downloaded the latest Spring ToolsSuite IDE based on the latest Eclipse. When I import my project as a Maven project, Eclipse/STS appears to use the Maven goals for building my project. This means AspectJ finally works correctly in…

Robert Campbell
- 6,848
- 12
- 63
- 93
7
votes
3 answers
How to statically weave JPA entities using EclipseLink when there is no persistence.xml as the entities are managed by Spring
I've got a project that is Spring based, so the entity manager is set up progammatically, with no need for persistence.xml files to list all the entities.
I'm currently using load time weaving but am trying to get static weaving working using…

PaulNUK
- 4,774
- 2
- 30
- 58
7
votes
1 answer
AspectJ + Gradle + Lombok does not work
There's a solution in ANT regarding this, but how do we accomplish this with gradle? Is it possible to do this via post-compilation weaving. Meaning compile with lombok to get all the generated delombok code, then have the aspect weave on this…

Setzer
- 739
- 4
- 10
- 18
7
votes
4 answers
How do you use Java 1.6 Annotation Processing to perform compile time weaving?
I have created an annotation, applied it to a DTO and written a Java 1.6 style annotationProcessor. I can see how to have the annotationProcessor write a new source file, which isn't what I want to do, I cannot see or find out how to have it modify…

Steve
- 71
- 1
- 2
7
votes
1 answer
How to configure aspectj to get post-compile weaving (with maven)?
How to configure AspectJ in order to get post-compile weaving? I just replaced "compile" with "post-compile" in the plugin below: (needless to say that was unseccessful)
org.codehaus.mojo
…

Sanyifejű
- 2,610
- 10
- 46
- 73
7
votes
3 answers
Confused how ajc works with javac
I'm a little confused how the AspectJ compiler, ajc works. To my understanding when talking about CTW, ajc is used to weave aspects into the compiled byte-code - ie: the .class file.
However, when I look at the maven-plugin for AspectJ…

Eric B.
- 23,425
- 50
- 169
- 316
6
votes
1 answer
AspectJ - Compile-time vs load-time weaving
I am having trouble understanding aspectJ's compile-time and load-time weaving and figuring out what to use(and how to use ajc) to compile and build my project.
Here's my project structure:-
TestProject : a java service library.
This is being used…

soontobeared
- 441
- 4
- 9
- 30
6
votes
3 answers
eclipselink static weaving with final fields on Java 9
I have some JPA annotated fields declared final like this:
@Column(name = "SOME_FIELD", updatable = false, nullable = false)
private final String someField;
Those fields are stored in the database when the entity is inserted in the database. They…

Stéphane Appercel
- 1,427
- 2
- 13
- 21
6
votes
2 answers
Compile time weaving for DI in non-spring managed classes
I want to configure compile time weaving for classes marked with @Configurable annotation to be able to inject spring dependencies to classes instatiated with new operator. I don't want to use load-time weaving because I don't have access to run…

maks
- 5,911
- 17
- 79
- 123
5
votes
2 answers
spring aspectj - compile time weaving external jar
I have a project which uses compile time weaving of aspects. this project depends on another project, which is a included as a jar. I want to weave a class in the jar file while compiling. How can i achieve this.
Thanks

user373201
- 10,945
- 34
- 112
- 168
4
votes
2 answers
How to enable compile-time aspectj weaving for Eclipse embedded Tomcat
I'm having a problem trying to make eclipse and aspectj work for Dynamic Web Projects. I'm looking for compile time weaving so I can use the Eclipse Visualisation features.
I've followed the steps given…

Alex
- 670
- 11
- 21
4
votes
2 answers
Let eclipse use maven to compile/weave my code
I am using compile time weaving with aspectj to weave in Spring's transactional code so I can use @Transactional. When i run maven compile from inside Eclipse (which uses the aspectj-maven-plugin), eclipse synchronizes to the tomcat server and all…

Cojones
- 1,906
- 22
- 25
4
votes
1 answer
How to achieve AspectJ compile time weaving using Spring BOOT and Gradle in an multi module project(weaving all modules)?
I want to configure Spring BOOT to use AspectJ's compile time weaving.
The base problem that I face is annotations like @Transactional, @Cacheable are ignored if the annotation function is called from within the same object. I know self autowiring…

Aditya Kumar
- 133
- 1
- 2
- 11
4
votes
0 answers
Applying AspectJ with Compile Time Weaving to a Spring Boot application without external dependencies
I'm setting up a SpringBoot application, which should be executed on the commandline.
The application contains multiple CommandLineRunners, which run their specific logic if the needed option was passed by through the commandline execution.
I use…

Monac
- 108
- 9