Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] When using copy-dependencies with tycho, how do I prevent manifest dependencies from being copied?

Ok. I will probably stick with explicitly listing out the dependencies I want to be copied.

Thanks,
Vasanth


On Tue, Nov 5, 2013 at 7:51 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
Short answer. Tycho has very limited support for traditional Maven
dependencies. What you need is not supported and I am not even sure what
needs to change to make this possible.

--
Regards,
Igor


On 11/5/2013, 5:42 PM, Vasanth Velusamy wrote:
I could use includes and excludes, but I will be repeating what is
already specified in the pom dependencies section, which is something I
am trying to avoid.

Let me elaborate.


I have a plugin x.y.z. It has dependency on jar files a.jar and b.jar.
These jars are not part of the project in version control system. There
are two dependencies declared in pom.xml for a.jar and b.jar. At build
time, the jars are pulled in as needed using copy-dependencies as
explained earlier. The plugin also has osgi dependencies listed in
manifest.mf - say org.eclipse.jface and org.eclipse swt.

Manifest.mf refers to the jar files as lib/a.jar and lib/b.jar. I make
the jar files available in 'lib' folder using copy-dependencies. So,
when I do mvn package, the jar files first get copied over to the lib
folder, and then tycho compiles the source files. Everything works fine.

The issue is, when I look at the lib folder, I see that a.jar and b.jar
are copied over fine. But I also see org.eclipse.swt.jar and
org.eclipse.jface.jar in lib. And also transitive dependencies from
a.jar and b.jar.

It seems like something like <excludeScope>provided</excludeScope> and
<excludeTransitive>true</excludeTransitive> should produce the results I
want - include only dependencies listed in the pom, and exclude any
transitive dependencies and manifest dependencies. But they don't seem
to take effect.

If I follow your suggestion and use includeArtifactIds/includeGroupIds
or any such filter, I will have to explicitly specify all dependencies
that I have already listed in the dependency section of the pom. Seems
redundant, and would be more maintenance. If someone adds a new
dependency in the pom, they will have to remember to add it to the
copy-dependencies filter as well.

Hope that gives you more information about the issue I am facing.

Thanks,
Vasanth


On Tue, Nov 5, 2013 at 5:14 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx
<mailto:igor@xxxxxxxxxxxxxx>> wrote:

    Not sure what you are trying to achieve, but you should be able to pick
    dependencies you need with includes/excludes dependency:copy-depenency
    filter parameters to pick dependencies you need and ignore the rest.

    http://maven.apache.org/__plugins/maven-dependency-__plugin/copy-dependencies-mojo.__html

    <http://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html>

    --
    Regards,
    Igor


    On 11/5/2013, 4:53 PM, Vasanth Velusamy wrote:

        I am using tycho for building a plugin project. The project requires
        some third party library jars that are copied over during the
        generate-sources phase using copy-dependencies. But the problem is,
        copy-dependencies copies all dependencies including the osgi
        ones listed
        in the manifest file. Is there a way to avoid this?

        <plugin>
        <groupId>org.apache.maven.__plugins</groupId>
        <artifactId>maven-dependency-__plugin</artifactId>

        <executions>
        <execution>
        <id>copy-dependencies</id>
        <phase>generate-sources</__phase>

        <goals>
        <goal>copy-dependencies</goal>
        </goals>
        <configuration>
        <outputDirectory>${basedir}/__lib/</outputDirectory>
        <excludeTransitive>true</__excludeTransitive>
        <addParentPoms>false</__addParentPoms>
        <excludeScope>provided</__excludeScope>

        </configuration>
        </execution>
        </executions>
        </plugin>

        This ends up copying all dependencies listed in the pom (what I
        want),
        but it also copies all osgi dependencies listed in manifest.mf
        (not what
        I want).

        Are there any other flags that I am missing?

        This question was asked earlier in this mailing list, but there
        has been
        no reply. I found a suggestion to use
        <excludeScope>provided</__excludeScope> in copy-dependencies,

        but that
        doesn't seem to work.

        Thanks,
        Vasanth


        _________________________________________________
        tycho-user mailing list
        tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>
        https://dev.eclipse.org/__mailman/listinfo/tycho-user
        <https://dev.eclipse.org/mailman/listinfo/tycho-user>

    _________________________________________________
    tycho-user mailing list
    tycho-user@xxxxxxxxxxx <mailto:tycho-user@xxxxxxxxxxx>
    https://dev.eclipse.org/__mailman/listinfo/tycho-user

    <https://dev.eclipse.org/mailman/listinfo/tycho-user>




_______________________________________________
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


Back to the top