Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Using a maven artifact dependency in a plugin?

I usually use maven-bundle-plugin <Embed-Dependency> to "wrap" maven
dependencies in OSGi bundles. The I add <dependency> on the wrapper
bundle and pomDependencies=consider in my Tycho projects. This is not
pretty, but works for small number of Maven dependencies. For example,
this is how m2e-maven-runtime is setup.

Alternatively, there is an experimental Nexus plugin Sonatype recently
opensourced. This plugin automatically generates OSGi bundle for maven
artifacts, but I have not personally used this plugin for anything
larger than a "hello-world" kind of a project.

--
Regards,
Igor

On 11-11-29 6:41 AM, motes motes wrote:
I use tycho 0.13. I have a plugin project where I would like to use a
maven dependency from nexus (the dependency does not have any osgi
headers). Here is what I have tried:

1)
Add the dependency in the pom file and during build copy it to the
root of the plugin using the maven-dependency-plugin:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>download.maven.dependencies</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>com.thoughtworks.xstream</groupId>
									<artifactId>xstream</artifactId>
									<version>1.4</version>
									<overWrite>true</overWrite>
									<outputDirectory>${basedir}</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>

This will not work since the target is resolved before the artifact is copied.


2)
Download the artifact and use eclipse to convert it into a plugin and
reupload it to nexus. Use a separate project based on the
tycho-extras-plugin where I add the osgified artifact as a dependency
and build a p2 site containing the artifact/bundle. Next I can use
this p2 site when I build my main project. This works but requires
some manual steps+the tycho-extras-plugin hack.


3)
Any suggestions?
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top