Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] [m2e-users] Can tycho pull feature dependencies from a non local repository?

Thorste,

the way I am using standard OSGI artifacts available in Maven repositories (Central,...) is to use Nexus Sonatype with the Nexus P2 plugin that is able to transform any Maven2 repository into a P2 repository.
So Central is for me a P2 repository and I just need to add this P2 repo in my target file to be able to use those artifacts

Regards
Jeff



On Tue, Nov 13, 2012 at 1:15 PM, Thorsten Schlathoelter <tschlat@xxxxxx> wrote:
Sry for posting again in the wrong list but I would like to complete this here. At least for my problem I found a solution using the maven-dependency-plugin:get goal. The following will grab the required artifacts from the nexus and put it into the local repository:


        <properties>
                <rcp.groupId>a.group</rcp.groupId>
                <rcp.artifactId>a.plugin</rcp.artifactId>
                <rcp.artifact.version>1.0.0-SNAPSHOT</rcp.artifact.version>
        </properties>

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-dependency-plugin</artifactId>
                                <version>2.5.1</version>
                                <configuration>

                                </configuration>
                                <executions>
                                        <execution>
                                                <id>getP2Metadata</id>
                                                <phase>validate</phase>
                                                <goals>
                                                        <goal>get</goal>
                                                </goals>
                                                <configuration>
                                        <groupId>${rcp.groupId}</groupId>
                                                        <artifactId>${rcp.artifactId}</artifactId>
                                                        <version>${rcp.artifact.version}</version>
                                                        <classifier>p2metadata</classifier>
                                        <packaging>xml</packaging>
                                </configuration>
                                        </execution>
                                        <execution>
                                                <id>getP2Artifacts</id>
                                                <phase>validate</phase>
                                                <goals>
                                                        <goal>get</goal>
                                                </goals>
                                                <configuration>
                                        <groupId>${rcp.groupId}</groupId>
                                                        <artifactId>${rcp.artifactId}</artifactId>
                                                        <version>${rcp.artifact.version}</version>
                                                        <classifier>p2artifacts</classifier>
                                        <packaging>xml</packaging>
                                </configuration>
                                        </execution>
                                        <execution>
                                                <id>getP2Jar</id>
                                                <phase>validate</phase>
                                                <goals>
                                                        <goal>get</goal>
                                                </goals>
                                                <configuration>
                                        <groupId>${rcp.groupId}</groupId>
                                                        <artifactId>${rcp.artifactId}</artifactId>
                                                        <version>${rcp.artifact.version}</version>
                                        <packaging>jar</packaging>
                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>


-------- Original-Nachricht --------
> Datum: Tue, 13 Nov 2012 00:01:27 -0500
> Von: Igor Fedorenko <igor@xxxxxxxxxxxxxx>
> An: m2e-users@xxxxxxxxxxx, Tycho user list <tycho-user@xxxxxxxxxxx>
> Betreff: Re: [tycho-user] [m2e-users] Can tycho pull feature dependencies from a non local repository?

> No, Tycho is not able to consume p2 artifacts from remote maven
> repositories. Maven repositories do not provide enough metadata to be
> able to do this efficiently. Tycho is able to instrument local maven
> repository with required metadata but this is not possible to do with
> remote repositories.
>
> Also, in the future please use tycho-user@xxxxxxxxxxx mailing list for
> questions about using Tycho.
>
>
> --
> Regards,
> Igor
>
> On 12-11-12 3:40 PM, Thorsten Schlathoelter wrote:
> > Hi all,
> > I have an OSGI bundle build with tycho that I deployed into a non local
> nexus repository. Now I would like to build a feature that contains this
> bundle and I would like to have maven/tycho pull this bundle from the central
> repository. Now the question is: is this possible with tycho? I am using
> Version 0.15.0. And my experience is that tycho is able to build the feature
> when the bundle is already in the local .m2 repository. So the build of
> the plugin was already executed locally. In that case also the artifacts.xml
> and metadata.xml files are present. If I remove the content from .m2 the
> build fails with an unsatisfiable dependency error.
> >
> > I have already unsuccessfully tried to add the bundle as a dependency to
> my pom.  Currently I have my central maven nexus repository configured in
> settings.xml. For tycho I have configured a P2-Repository that contains the
> platform bundles (but not the bundle I am trying to pull).
> >
> > Again: everything works fine if I have the bundle artifacts in my local
> .m2. Only if the bundle artifacts are removed, I get an unsatisfiable
> dependency error. The expectation is that the missing artifact is pulled from
> the central repository which definetly contains the artifact.
> >
> > I am fairly new to maven and would appreciate any hint on how to
> configure this.
> >
> > Regards,
> > Thorsten
> >
> >
> > _______________________________________________
> > m2e-users mailing list
> > m2e-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/m2e-users
> >
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Back to the top