-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature: Determine agent class from manifest
Now, config property 'agentClass' is optional and should rarely be necessary, e.g. in case of invalid agent JARs without manifests or with missing 'Agent-Class' manifest entries. IT SpringBootAspectJ tests both cases.
- Loading branch information
Showing
7 changed files
with
105 additions
and
15 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/it/RemoveFinalAgent/src/main/java/dev/aspectj/agent/NonManifestRemoveFinalAgent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.aspectj.agent; | ||
|
||
import org.objectweb.asm.ClassReader; | ||
import org.objectweb.asm.ClassWriter; | ||
|
||
import java.lang.instrument.ClassFileTransformer; | ||
import java.lang.instrument.IllegalClassFormatException; | ||
import java.lang.instrument.Instrumentation; | ||
import java.security.ProtectionDomain; | ||
|
||
import static org.objectweb.asm.ClassReader.SKIP_DEBUG; | ||
import static org.objectweb.asm.ClassReader.SKIP_FRAMES; | ||
|
||
/** | ||
* Alternate agent class which is not configured in the manifest, bug can be reached by setting the embedder plugin's | ||
* {@code javaAgents/agent/agentClass} configuration property | ||
*/ | ||
public class NonManifestRemoveFinalAgent { | ||
public static void premain(String targetClasses, Instrumentation instrumentation) { | ||
RemoveFinalAgent.transform(targetClasses, instrumentation); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters