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