jcabi-maven-plugin | Supplementary maven plugin for AspectJ | Plugin library
kandi X-RAY | jcabi-maven-plugin Summary
kandi X-RAY | jcabi-maven-plugin Summary
More details are here: plugin.jcabi.com.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Execute AJC mojo
- Version for versions .
- Execute Mojo .
- Creates the text in text format .
- Retrieves the files for a given dependency
- Copy unwoven classes .
- Executes mojo .
- Copies all files from one directory to another .
- Returns the given string value if it is not null .
jcabi-maven-plugin Key Features
jcabi-maven-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on jcabi-maven-plugin
QUESTION
I'm trying to run a little annotation over function that will log before and after the method execution.
What I've done: (all classes are under src/main/kotlin
)
Annotation class
...ANSWER
Answered 2019-Jul-05 at 02:41Disclaimer:
- I have never used the Jcabi plugin before, normally I always use AspectJ Maven plugin, also for binary weaving.
- I have never used the Kotlin language before, normally I use Java or Groovy.
Now some things are not okay in your aspect:
- It must not be
abstract
, otherwise no instance can be created. - For
void
methods it must be able to returnnull
, so the Kotlin return type should beAny?
- You should
proceed()
in between the before and after log messages, otherwise the log output will be wrong. - Assuming that your classes, especially the annotation class, do not reside in the default package but have an actual package name, you need to use the fully qualified class name in your pointcut, e.g.
@annotation(de.scrum_master.app.LogMe)
- Using an aspect class name
Aspect
, i.e. the same name as the@Aspect
annotation, just in another package, is kind of ugly. You should rename it.
For me this works nicely:
QUESTION
I have an integration-test which calls a micro-service (abc-service) implemented using drop-wizard framework. My integration test calls a resource end point inside the micro-service. This abc-service has dependencies on 2 modules, which I have it in abc-service pom.xml
a. Aspect-module
b. Xyz-module --> this module makes http calls to outside service (not in our domain). This xyz-module has got 15 manager classes and each class has a public static methods, which makes http calls to outside service, I want to calculate processing time for all http calls, i.e I want to apply @Around advice on all public static methods which makes http calls in all manager classes. All classes in xyz-module are non-spring managed beans
Code in Aspect-module
...ANSWER
Answered 2018-Nov-05 at 11:49I inspected your GitHub repo. First I unpacked and removed all ZIP files (very ugly to commit them, especially including target directory contents) and added a parent POM in order to be able to properly build the whole project. Then I noticed that there were several things wrong:
If you want to use your aspect module via LTW, you need to provide a properly configured aop.xml file according to the AspectJ LTW documentation, e.g. like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jcabi-maven-plugin
You can use jcabi-maven-plugin like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jcabi-maven-plugin component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page