Running Eclipse inside Tycho using reactor artifacts - eclipse

Is there a way to make the tycho-eclipserun-plugin:eclipse-run goal resolve dependencies against artifacts in the current reactor or in the local repository. I'm trying to run the Eclipse/CDT headless build application as a step in our Tycho build, but I cannot figure out how to populate the Eclipse instance with the newly-built toolchain plugins.
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<executions>
<execution>
<configuration>
<appArgLine>-application org.eclipse.cdt.managedbuilder.core.headlessbuild -import file:///... -cleanBuild all</appArgLine>
<repositories>
<repository>
<url>http://download.eclipse.org/releases/kepler/</url>
<layout>p2</layout>
</repository>
</repositories>
<dependencies>
...
<dependency>
<artifactId>my.toolchain.feature</artifactId>
<type>eclipse-feature</type>
</dependency>
</dependencies>
</configuration>
<goals>
<goal>eclipse-run</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
This will fail since my toolchain plugins are not present in the Eclipse instance which hosts the headless build application. I could, of course, point out an external update site which hosts the plugins, but I would like to be able to use the plugins which are already being built in the same reactor. Is that possible?
EDIT: Original question included "or local repository artifacts", but that was not what I actually meant.

No, this is not possible.
Earlier versions of Tycho allowed using artifacts from the reactor for the eclipserun-plugin, but this caused problems for projects which build upstream artifacts from the artifacts they used for the eclipserun-plugin, namely the Eclipse Platform. So to fix this, the artifacts used by the eclipserun-plugin were decoupled from the reactor & reactor dependencies in Tycho 0.17.0.
One could imagine ways to re-allow this use case, but this is currently just not implemented. AFAIK there are no concrete ideas yet how to do this. If you want to contribute one, you could file an enhancement in Tycho's issue tracker.

The easiest way I could find is to use the maven-dependency-plugin to copy the repository from the repository-module:
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<goals>
<goal>unpack</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.iar</groupId>
<artifactId>my.toolchain.repository</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>zip</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
This will copy and unpack the repository locally. It can then be specified as a repository when calling the eclipserun target:
<repository>
<url>file://${project.build.directory}/dependency</url>
<layout>p2</layout>
</repository>
The only thing you need to know is the GAV of the "eclipse-repository" module which contains the repository you need.
EDIT: This turned out to not work as I expected. It will pull artifacts from the local repository, and not from the reactor as I expected.

Related

Dynamic maven artifactId

Is it possible for a POM to declare (or at least publish) an artifactId containing system properties? I mean the artifactId of the actual project, not dependencies.
I am using maven to build a scala project and thus, to allow publishing the project for different scala versions, in the pom.xml I'd like to declare:
<artifactId>myproject_${scalaBinaryVersion}</artifactId>
however maven 3.3. complains
[WARNING] 'artifactId' contains an expression but should be a constant
Since I'd like this project to be interoperable with sbt, what would be the best way to publish an artifact suffixed with the scala binary version?
The Maven way of doing so would be to use classifiers. From official documentation an example matches exactly your case (for different Java versions, but you can replace Java with Scala):
The classifier allows to distinguish artifacts that were built from the same POM but differ in their content. It is some optional and arbitrary string that - if present - is appended to the artifact name just after the version number.
As a motivation for this element, consider for example a project that offers an artifact targeting JRE 1.5 but at the same time also an artifact that still supports JRE 1.4. The first artifact could be equipped with the classifier jdk15 and the second one with jdk14 such that clients can choose which one to use.
You can configure your POM as following:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>${scalaBinaryVersion}</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Note: we are adding an additional execution of the Maven Jar Plugin, so the project would create two jars, the normal one + an additional one with the specified (dynamic) classifier.
Then Maven will automatically publish the classified jar together with the normal jar (since it will be automatically attached to the build). You can then import it as a further Maven dependency in another project specifying its classifier as part of the Maven GAV (GAVC in this case):
<dependency>
<groupId>your.group.id</groupId>
<artifactId>your.constant.artifact.id</artifactId>
<version>your.version</version>
<classifier>your.dynamic.classifier</classifier>
</dependency>
If you want to only build the classified one and no standard (unused) jar, you can skip the creation of the normal jar as following:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>scala-version-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>${scalaBinaryVersion}</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Note: we are simply overriding the default execution of the Jar Plugin and binding it to a non existing phase. Hence Maven will only generate the classified Jar. The Install Plugin will then only install the classified one.
Update: how to have dynamic artifactId installed with dynamic dependencies
If different transitive dependencies are required for different dynamic versions, then indeed classifiers are not suitable.
Dynamic artifactIds with dynamic dependencies (and hence dynamic transitive dependencies) can however be achieved. Here below is the approach I used (and successfully tested):
As preference, I isolated the dynamic behavior in a profile, but you can obviously move it back to the default build (or have the profile active by default).
First of all, let's define in our pom the dependencies requiring a dynamic version, hence via properties as following:
<properties>
<scalaBinaryVersion>scalaversion</scalaBinaryVersion>
<dependency.version>4.11</dependency.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${dependency.version}</version>
</dependency>
</dependencies>
Note: for the sake of an example, I'm using Junit as dependency in this case and not in test scope, because I want it as compile dependency (again, just for this example).
Then let's define a profile for our dynamic behavior:
<profiles>
<profile>
<id>build-scala-version</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<finalName>${project.artifactId}_${scalaBinaryVersion}-${project.version}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-pom</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${scalaBinaryVersion}</outputDirectory>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>pom.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>replace-artifactid</id>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>target/${scalaBinaryVersion}/pom.xml</file>
<token><artifactId>${project.artifactId}</artifactId></token>
<!-- Replace to -->
<value><artifactId>${project.artifactId}_${scalaBinaryVersion}</artifactId></value>
<outputDir>target\${scalaBinaryVersion}\replacer</outputDir>
<outputFile>pom.xml</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>default-install</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>install-scala-version</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}_${scalaBinaryVersion}</artifactId>
<version>${project.version}</version>
<packaging>${project.packaging}</packaging>
<file>${project.build.directory}/${project.artifactId}_${scalaBinaryVersion}-${project.version}.jar</file>
<pomFile>${project.build.directory}/${scalaBinaryVersion}/replacer/pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Note, the profile is customizing and providing the following:
Changing the final Jar name with a dynamic name, depending on the runtime (aka dynamic) value, to ${project.artifactId}_{scalaBinaryVersion}-${project.version}
Filtering the existing pom file via the Maven Resources Plugin and copying it to the directory target\${scalaBinaryVersion}. The copied pom will have the dependencies with the dynamic version because the Resources Plugin will replace them. However, it will not have the dynamic artifactId (yet).
Finalizing the dynamic pom file. The Replacer plugin will replace the artifactId XML element with the dynamic value (working on the target folder, hence everything on temporarely files)
Skipping the generation of the default installation
Performing a custom install-file installation with the dynamic pom file (the filtered, copied and replaced one, providing dynamic dependencies (and as such dynamic transitive dependencies) and a dynamic artifactId
Hence, performing the following maven invocation:
mvn clean install -Pbuild-scala-version -DscalaBinaryVersion=hello -Ddependency.version=4.4
Maven will effectively install a new artifact in the local cache for the dynamic artifactId, the dynamic dependency version and the dynamic pom.
Note: if the concerned dependency version(s) and the dynamic scala version is the same, then you can save up a parameter and make the invocation shorter and more consistent.
if you are using maven for that I will saggest using multi pom with maven helper plugin so the artifactId is constant in each module.
We follow the properties (via profiles) based approach as suggested here: scala-maven-plugin FAQ
<artifactId>something_${scala.compat.version}</artifactId>
<properties>
<scala.compat.version>2.12</scala.compat.version>
</properties>
maven will still issue a warning (with good reason), but with the help of the flatten-maven-plugin we build/install poms that has the variables replaced.

Maven GWT Plugin copies multiple versions of the same snapshot jars

I have this issue where I build my project (mvn clean install), some of the transitive dependencies are snapshot versions and are downloaded and copied into the target webapp directory e.g XXXUtil-1.0-20110922.172721-52.jar. Then when I run mvn gwt:run, it finds uses XXXUtil-1.0-SNAPSHOT.jar and copies it to the target webapp directory. I can't figure out why this is happening. In doesn't matter whether I run as exploded or inplace.
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0-1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<configuration>
<runTarget>Shell.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.myapp.client.Messages</i18nMessagesBundle>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- <outputFileNameMapping>#{artifactId}#-#{version}#.#{extension}#</outputFileNameMapping> -->
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
</plugins>
None of the suggestions described here help:
http://www.tikalk.com/alm/forums/maven-war-plugin-picking-multiple-version-same-snapshot-jars.
If i build local snapshots of XXXUtil-1.0-SNAPSHOT.jar it works buts not when downloading snapshots from a nexus repository. Another way to look at it is like this Project A generates a WAR, and depends on B.jar, which depends on C.jar. When i build my war using mvn install, it generates the correct jars in WEB-INF/lib so we have C-1.0-20110922.172721-52.jar. Which is correct and it works if i deploy my war. If i run in hosted mode using eclipse, its fine. But when i run mvn:gwt-run, C-1.0-SNAPSHOT.jar is copied into WEB-INF/lib so i have 2 jars C-1.0-SNAPSHOT.jar and C-1.0-20110922.172721-52.jar.
The only thing I can suggest you is to try to debug maven-gwt-plugin.
Checkout it from git repository
https://github.com/gwt-maven-plugin/gwt-maven-plugin.git
I had exactly the same problem. After debugging, I removed the use of maven-war-plugin and added maven-resources-plugin (compile phase, copy-resources goal). I tried gwt:run and install after that, worked without any problems. This way, we avoid the dependencies getting copied twice.

M2E and having maven generated source folders as eclipse source folders

I have a maven project in eclipse and have maven goals that run annotation processors to generate code. The output folder for this code is target/generated-sources/apt.
In order for Eclipse to see this generated code I need to add target/generated-sources/apt as a source folder to the Eclipse project.
However, this causes there to be an error of type "Maven Configuration Problem" saying
Project configuration is not up-to-date with pom.xml. Run project
configuration update
I think I understand why this is the case as Eclipse has a different set of source folders to Maven's set. But I need this different set, as I need Eclipse to be able to see the generated source folders...
When doing a pure Maven built, these source folders will be included in the build, by Maven.
BTW, I have upgraded to the official Eclipse release of the Maven Eclipse plugin, m2e 1.0 - what used to be m2eclipse. I'd like to see if I can find a work around/solution to this with the m2e plugin before I have to go back to the old m2eclipse version.
You need to attach the source directory with the build-helper-plugin.
Like so:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/java/</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
You will also need to:
Install the "Apt M2E Connector" from the Eclipse Marketplace.
To do so click the error in the Overview tab of your pom.xml and select "Discover".
Ensure there are no plugin execution filters for the build-helper-maven-plugin (see https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html)
Right-click the Error message:
Project configuration is not up-to-date with pom.xml Run project
configuration update
in the Problems View and select Quick Fix and click Finish to select the default Update project configuration. This fixes it.
After switching to new versions of m2e/maven/apt,... i had builderrors because of the duplicated files, caused by the added buildpath by the buildhelper, so i needed to remove the "apt-generated"-Folders from the buildhelper.
To fix the Problem in Eclipse, not adding the "apt-generated"-folder via Update Maven Configuration in M2E, i've written a M2E Plugin to fix this problem. It adds the outputDirectories configured in the maven-apt-plugin to the buildpath of the Project.
https://apt-m2e.googlecode.com
In m2e 1.0 the handling of Maven plugins has changed. You might be lacking a specific m2e extension for your code generating plugin. Here is all the documentation I managed to find.
This bug report may also be relevant.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350081
request on CXF JIRA (see 1) to add lifecycle mappings in the cxf-codegen-plugin itself. This would require m2e 1.1 but I believe it is better approach than having connectors built outside of cxf project, assuming that lifecycle mapping API would change less frequently than cxf-codegen-plugin and cxf.
You can also use the buildhelper m2e connector available in the discovery catalog. I'm using Eclipse 3.7
Eclipse Java EE IDE for Web Developers.
Version: Juno Service Release 1
mvn archetype:generate \
-DarchetypeGroupId=org.codehaus.mojo \
-DarchetypeArtifactId=gwt-maven-plugin \
-DarchetypeVersion=2.5.0
mvn clean install
work perfectly.
But in eclipse I have the same error on Asinc class.
Just press F5 on project. Fix this problem.
This was what I found that worked good using spring 3.1.1 which does have the 3.0.6 version as well in it. Once I got the plugins setup and put into the correct area of the pom and included the argline and endorseddirs to have the java sources put out into the target/generated-sources/cxf folder then maven generated the sources ok.
....
<properties>...
<dependencyManagement>
<dependencies>.....
</dependencyManagement>
<dependencies>
<dependency>....
</dependencies>
<!-- *************************** Build process ************************************* -->
<build>
<finalName>eSurety</finalName>
<plugins>
<!-- Force Java 6 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Deployent on AS from console
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>${version.jboss.as.maven.plugin}</version>
</plugin>
-->
<!-- wildbill added tomcat plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<!-- Surefire plugin before 2.9 version is buggy. No need to declare here,
it's being referenced below w/ the version
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
</plugin>
-->
<!-- developer added these -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<endorseddirs>target/generated-sources/cxf</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.endorsed.dirs=target/generated-sources/cxf</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArguments>
<endorseddirs>target/generated-sources/cxf</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.endorsed.dirs=target/generated-sources/cxf</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2</version>
</artifactItem>
<artifactItem>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2</version>
</artifactItem>
</artifactItems>
<outputDirectory>target/generated-sources/cxf</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
<!-- *********************** Profiles ************************************ -->
<profiles>
<profile>
<!-- When built in OpenShift the 'openshift' profile will be
used when invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization
your app will need. -->
<!-- By default that is to put the resulting archive into the
'deployments' folder. -->
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
<id>projName</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.5.2</version>
<executions>
<execution>
<id>process-sources</id>
<phase>generate-sources</phase>
<configuration>
<fork>once</fork>
<additionalJvmArgs>-Djava.endorsed.dirs=target/generated-sources/cxf</additionalJvmArgs>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
</plugin>
<!-- Actual war created in default target dir -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
If your wsdl folder is in ${basedir}/src/main/resources it'll find it automatically
Hope this helps!
~wildbill
In case for some reason you can't use the build helper plugin the easiest way (albeit not as convenient and somewhat tedious) I have found to deal with this is:
Separate the generated source code into its own project or sub module.
You will want to keep this project predominately closed or not imported into Eclipse when you are working on the parent project.
In the parent project that needs the generated code make sure to now depend on the generated source code project via Maven pom dependency.
When you need to update the generated code go to the generated code project and run mvn install. Now refresh the parent project by right clicking and selecting Maven->Update Project...
This generally works well for projects that use a semi static source for code generation such as SOAP WSDLs (Apache CXF) or code generated from a database (jOOQ). For APT and other AspectJ-like-code it doesn't work as well because you are editing the source frequently.
For new visitors to this question -
build helper maven plugins and m2e connectors go hand in hand. Older versions
(before 2.0) of build helpers have moved into an eclipse archive link
build helper versions archived
Pick the correct link from the list and add it as an eclipse update site. It should ask you for a bunch (seriously.. a huge bunch ) of eclipse updates . Please accept and you are good to go.
the configuration to the build helper plugin did work for us.
but be aware, that the destination folder always has to be equal to the configuration of the plugin u're using for the annotation processing itself.
for example the maven-processor-plugin uses the target folder ${project.build.directory}/generated-sources/apt as default. if you wish another destination for your generated source files you can set it by the tag as shown below.
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<defaultOutputDirectory>apt_generated</defaultOutputDirectory>
<processors>
<processor>com.any.processor.invoker</processor>
</processors>
</configuration>
</execution>
</executions>
</plugin>
Here is the solution
Open Marker View (Window > Show View
Right-click on the Error message
Select Quick Fix
Click Finish

How do I set the Scala compiler to use a plugin when I build using Maven?

So I have a Maven project with two submodules. The first is the compiler plugin itself, which gets compiled as I expect it to.
The second submodule is some example code that I want to compiler with the previously built compiler plugin.
So I have this in the pom file:
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDir>.</sourceDir>
<!--jvmArgs>
<jvmArg>-Xms64m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
</jvmArgs-->
<args>
<arg>-Xplugin:../plugin/target/plugin-1.0-SNAPSHOT.jar</arg>
</args>
</configuration>
</plugin>
Which based on what I could read about it, should give the right arguments to the compiler, but it doesn't seem to do anything at all.
Edit: As suggested, I tried to use the compilerPlugins tag, so the relevant area became:
<configuration>
<sourceDir>.</sourceDir>
<compilerPlugins>
<compilerPlugin>
<groupId>*groupid*</groupId>
<artifactId>plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
And that did indeed work, unfortunately it now produces this error:
Unable to find resource 'groupid:plugin:jar:1.0-SNAPSHOT' in repository scala-tools.org (http://scala-tools.org/repo-releases)
Which is quite understandable, as it isn't there.
I tried to add it as a dependency to the dependencies list, but that didn't change anything.
final edit:
executing:
mvn clean install
fixed it.
Thanks
Doesn't it work using the compilerPlugin configuration to set the artifact?
http://scala-tools.org/mvnsites/maven-scala-plugin/compile-mojo.html#compilerPlugins
Update: It's basically an artifact like a dependency. You will add your compiler plugin as artifact inside it:
<compilerPlugins>
<compilerPlugin>
<groupId>_your plugins groupId_</groupId>
<artifactId>plugin</artifactId>
<version>1.0-SNAPSHOT</groupId>
</compilerPlugin>
</compilerPlugins>

How to setup bundle development environment (Eclipse Equinox Maven)

I'am trying to setup eclipse environment to develop bundles (With maven-bundle-plugin-bnd)
and run & debug that bundles equinox from eclipse
I created sample bundles with org.apache.felix maven-bundle-plugin and can install and start that bundles from eclipse equinox,
but every time i need to run "install file:C:\path\bundle1.jar","install file:C:\path\bundle2.jar" which causes pain. i searched for run configuration but it only intalls and starts (plugin) projects in workspace not maven projects.
What i have done is create maven project and add dependencies(bundle1,bundle2 etc..) and added maven-dependency-plugin to copy all depended bundles in one folder (another problem is equinox use "_" delimeter to determine version of bundles but maven uses "-" as delimeter) if i do not strip version in standalone equinox application i need to give version of bundle in config.ini file but i dont want that, is this proper way to solve this problem?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${bundleDirectory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
To sum up , i have bundles in folder, which is created with org.apache.felix maven-bundle-plugin , how can i run and debug them from eclipse?
I wouldn't say this is a "proper" solution, but it may work for you.
The antrun plugin can be used to modify the dependencies to replace the final hyphen with an underscore, so the dependency plugin doesn't need to strip the version.
My regex is rusty, but from a little testing the following configuration appears to apply the required name change to the files in the bundleDependency directory.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${bundleDirectory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<!-- move within same directory is preferred method for a rename-->
<move todir="${bundleDirectory}">
<fileset dir="${bundleDirectory}"/>
<mapper type="regexp" from="([a-zA-Z0-9\.-]+)(-)([0-9\.]+.jar)"
to="\1_\3"/>
</move>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
I wrote a tool called auto-builder (http://code.google.com/p/auto-builder). It introspects PDE-based projects and generates Ant build files; it supports transitive closure over dependencies and all that jazz.
I posted a write-up: http://empty-set.net/?p=9. I wrote it because the Maven tools I played with, when integrated with PDE, didn’t “just work.” Basically, I wanted to do coding in PDE and have a Hudson-based CI without any fuss in between.
Generating Ant files is nice because it gives you all the benefits of a declarative build tool, but it leaves you with a procedural description of what it is doing.
I am looking for more PDE-based projects to test it on. There are a couple RFC-0112 Bundle repositories around, and I have some code for downloading dependencies. If anyone is interested, then I could integrate dependencies download with auto-builder.