Load-time weaving of maven dependencies of eclipse plugin [message #1105733] |
Tue, 10 September 2013 04:01  |
Eclipse User |
|
|
|
Hi,
I'm working on eclipse extension split to many plugins. One of them is plugin.libs that contains all needed non-osgi libraries. To do this I use plugins
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
I declared needed libraries in maven dependencies. To be able to run and debug this plugin correctly from eclipse launch, I needed to export maven dependencies in .classpath:
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Library jars are inside target jar.
Up to now everything works correctly.
For one of my dependencies I needed to introduce aspects. I used maven plugin
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
with configuration
<weaveDependencies>
<weaveDependency><groupId>my.dependency</groupId><artifactId>my.dependency.api</artifactId></weaveDependency>
</weaveDependencies>
and put my aspects into plugin.libs project. My solution works as espected. Library in target jar is extracted and in bytecode I can see introduceed aspects. When I install my plugins in other instance of eclipse (through update site) I confirm that apsects are executed.
Now I would like to run and debug my plugins in development environment. However, eclipse is taking into account maven dependencies of plugin.libs that are in local maven repository where aspects are not introduced.
My idea is to run eclipse with load-time weaving aspects. I've done something similar before with a standalone applicaction where I had added this in .classpath
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.ajdt.inpath" value="org.eclipse.ajdt.inpath"/>
</attributes>
</classpathentry>
My question is. How to run with ajdt the eclipse plugins with load-time weaving.
Thanks in advance,
Marek
|
|
|
|
|
Re: Load-time weaving of maven dependencies of eclipse plugin [message #1106055 is a reply to message #1106021] |
Tue, 10 September 2013 12:18   |
Eclipse User |
|
|
|
My plugin com.systemincloud.modeler.libs MANIFEST is generated automatically by felix maven plugin:
<plugin><groupId>org.apache.felix</groupId><artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-ManifestVersion>2</Bundle-ManifestVersion>
<Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<_exportcontents>
org.codehaus.plexus.*,
org.apache.commons.*,
com.systemincloud.api.*,
com.systemincloud.modeler.api.*,
com.google.common.*,
javax.ws.rs.*
</_exportcontents>
<Import-Package></Import-Package>
<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory></Embed-Directory>
<Bundle-Vendor>System in Cloud</Bundle-Vendor>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.7</Bundle-RequiredExecutionEnvironment>
<_failok>true</_failok>
<_nouses>true</_nouses>
<_nodefaultversion>true</_nodefaultversion>
<_snapshot>${osgi-version-qualifier}</_snapshot>
</instructions>
</configuration>
</plugin>
It gives :
Manifest-Version: 1.0
Bnd-LastModified: 1378825676440
Build-Jdk: 1.7.0_25
Built-By: marek
Bundle-ClassPath: .,com.systemincloud.modeler.api.javatask-0.1.0-SNAPSHO
T.jar,com.systemincloud.api.java-0.1.0-SNAPSHOT.jar,com.systemincloud.a
pi.java.msg-0.1.0-SNAPSHOT.jar,com.systemincloud.api.machine.java-0.1.0
-SNAPSHOT.jar, (... a lot more)
Bundle-ManifestVersion: 2
Bundle-Name: System in Cloud Modeler - Libs
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-SymbolicName: com.systemincloud.modeler.libs;singleton:=true
Bundle-Vendor: System in Cloud
Bundle-Version: 0.1.0.qualifier
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: *;scope=compile|runtime
Embed-Transitive: true
Embedded-Artifacts: com.systemincloud.modeler.api.javatask-0.1.0-SNAPSHO
T.jar;g="com.systemincloud.modeler.api";a="com.systemincloud.modeler.ap
i.javatask";v="0.1.0-SNAPSHOT",com.systemincloud.api.java-0.1.0-SNAPSHO
T.jar;g="com.systemincloud.api";a="com.systemincloud.api.java";v="0.1.0
-SNAPSHOT",(... a lot more)
Export-Package: org.apache.commons.io;version="1.4.9999",org.apache.comm
ons.io.input;version="1.4.9999",org.apache.commons.io.filefilter;versio
n="1.4.9999",org.apache.commons.io.output;version="1.4.9999",org.apache
.commons.io.monitor;version="2.4",org.apache.commons.cli;version="1.2",
org.apache.commons.io.comparator;version="1.4.9999",com.systemincloud.a
pi.machine.java.websocket.jwebsocket,com.systemincloud.api.java.cmd,com
.systemincloud.api.machine.java,com.systemincloud.api.machine.java.msg,
com.systemincloud.api.machine.java.websocket,com.systemincloud.api.java
.msg,com.systemincloud.api.java.msg.args,(... a lot more)
Tool: Bnd-1.50.0
I want to weave one of libraries that are inside of target bundle. With maven I compile aspects and the library is extracted inside bundle jar.
Marek
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04094 seconds