How to keep M2_REPO variable dynamic in Aspect Path of an Eclipse Java/AspectJ run configuration?

纵饮孤独 提交于 2019-12-25 11:55:17

问题


I'm trying to create a "Java/AspectJ application" run configuration for my Maven built project. Because i'm using Spring aspects i have to include the spring-aspects artifact in the run configuration's Aspect Path list. I'm adding it via the "Advanced.." button selecting "Add Classpath variable" and extending from the M2_REPO variable. So in the end i have a classpath variable entry in the list like this with a blue dot icon next to it:

M2_REPO/org/springframework/spring-aspects/3.1.3.RELEASE/spring-aspects-3.1.3.RELEASE.jar

However once i save it, Eclipse automatically replaces it in the launch file with the real path of the JAR on my machine making impossible to share the launch file with others since it's hard coding the entry to my environment.

Editing the launch file by hand doesn't help either because once i run it Eclipse replaces the expression the same way as above.

Is there any way to solve this?


回答1:


The solution was to create the entry under the "Aspectj Load-Time weaving application" run configuration category instead of the "Aspectj/Java Application". For some strange reason the path of the Aspect is kept in it's unresolved format only with the first run configuration type. I guess it's a bug.

Obviously this makes the launch time longer because it does the waving in run time aswell. However i can't seem to find other solution.



来源:https://stackoverflow.com/questions/18897954/how-to-keep-m2-repo-variable-dynamic-in-aspect-path-of-an-eclipse-java-aspectj-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!