Eclipse can't resolve a maven-bundle-plugin produced dependency - tycho

I made a bundle for a third-party lib with the maven-bundle-plugin as described here: http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp02/build01/pomfirst-thirdparty/pom.xml.
I can build my third-party lib and use it in another eclipse-plugin project which is build by the tycho-maven-plugin and whose dependencies are resolved by the target-platform-configuration plugin. So far so good.
But my eclipse can't resolve this dependency.

I think you are facing the problem explained in thread Eclipse support for pomDependencies=consider.
The suggested solution is:
You need to import pom-first projects into workspace, there is no
integration between PDE workspace target platform and Tycho
pomDependencies=consider feature.

Related

Intellij IDEA With Multiple Gradle Projects

I am working on two Gradle projects. One of these projects is a supporting library that will be used by other projects in the future so project A depends on project B but not as a 'multi module project'. The dependency is to be resolved through the artifact repo so project a declares it as a compile dependency using it's maven coordinates.
My problem is when working on these two projects in IntelliJ changes to project B aren't made available to project A until I install it (using the Gradle Maven plugin) in my local repo. This is kind of annoying and slows down my workflow. Is there a way to get IntelliJ to automatically update the dependency internally?
This is supported in the latest versions of Gradle and IntelliJ. It is known as a Composite Build.
Composite builds can be declared in the project's settings.gradle file as follows:
includeBuild '../my-app'
or by using the --include-build command line argument:
$ gradle --include-build ../my-utils run
Take a look at the Composite Builds with Gradle and IntelliJ IDEA Webinar for instructions on how to configure the integration.
In IDEA 2017 you can right-click on the gradle module and use Composite Build Configuration to link the current module to one or more gradle module already opened in the current workspace.

Why does IntelliJ IDEA 13 require both lib project and lib itself (google-play-service) to be added as a dependency?

Reading Google instructions, I found that I have to import and reference the Play Service library into the project.
So I created a project, copied google-play-service_lib project, imported it as a library project, went to the main project and added this library as a Module dependency. However, I still have an error that IntelliJ IDEA does not recognize package com.amazon.device.ads.*.
So I had to add a library dependency as well, although this library already exists in the /lib directory of Play Service library project.
Am I doing something wrong or we're actually requested to add both dependencies in IntelliJ IDEA? If yes, is this maybe a bug in IntelliJ IDEA 13? I can't remember of having to do the same in earlier versions of IntelliJ IDEA (I have been using it for three years).
This is how it looks in the end and it works only this way! Check the last two dependencies.

Custom artifact generation on Intellij Idea 13 and Gradle

I'm using the Intellij Idea 13 Gradle plugin and I'd like to modify the default artifact creation.
The problem I face is that my war modules have dependencies on 3rd party libraries that I don't want to include in the war itself, however I would like to include them in the Intellij artifact so they are deployed to my local server for testing.
At the moment I'm getting errors of the type Artifact ... library required for module is missing from the artifact.
What would be the best way to tell Intellij to add those libraries?
Thanks
I haven't found the way to add those libraries, but I've found the way to set them as provided so they can be added to the server lib folder.
The solution is detailed here: Provided dependencies using Gradle (JetGradle) and Intellij Idea 13

How to include required jars in project while using Maven?

I am new to Maven and using it to build a project on my local. This is working nicely on my local. Now, I want to run the same project on my server and the server does not have Maven installed. So I wanted to ask if there is any way by which, when I build a Maven project on my local, I could include all the required jars in it and then simply transfer it to my server? I know Maven creates the repository in C:\Documents and Settings\username\.m2 on Windows.
But how can I include all the jars in project the way we do traditionally? I saw this question. But it talks about creating a custom repository and I don't have Maven installed at all. so I guess it is not a suitable solution to me.
Thanks.
You can use the Maven Assembly Plugin. From the documentation:
The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive.

How do I add 3rd-party OSGi bundles to a deployment package with Maven?

I'm building my application to run in an OSGi container. I use Maven and the Maven Bundle Plugin from Apache Felix to set up the OSGi manifests for my own modules and that works great.
Now, I'm deploying my bundles into an OSGi container together with several 3rd party libraries. Some of these are already OSGi-fied when I get them from the Maven repos, others, I want to convert into OSGi-compatible jars. I want to set up a Maven project that collects all dependencies, and puts each in its own OSGi jar. The ultimate goal is to collect these jars and my own into an assembly that I can use as a standalone deployment package.
I know how to convert standard jars to OSGi jars, and I have a (somewhat hackish) approach to merge multiple OSGi bundles, even if I probably shouldn't. But if I have a dependency that's already fine as it is, and I just want to copy it from the repo into my assembly, what part of Maven do I use? The bundle plugin is wrong, it messes up the manifests if a dependency is already OSGi-compatible. Do I use the dependency-plugin, the assembly plugin or something else?
I have the feeling I'm overlooking something very simple here.
Did you have a look at the PAX tools? In particular Pax-Runner and
pax-construct... They do not only give you a nice template to start with, but also solve most the problems you mentioned for free.
We use many libraries which are not OSGified by the vendor and which are not available on the Spring bundle repository. We also have many of these and want to deploy them all together hassle free. For this we have created a 2-layer maven setup:
Individual maven projects that either download or contain (as 'system' scope depends) the 3rd party lib in question, and OSGify these using the Apache Felix bundle plugin
One container project that has a dependency on all of these small projects and makes an assembly of them using the core assembly maven plugin. This POM also uses the copy-dependencies goal of maven to make sure everything is in place.
Once it is turned into an assembly (ours is a tar file) we deploy this to our servers. We have gone one step further and used this assembly of 3rd party libraries as the Target Platform for our Eclipse build environment. But this may be irrelevant for you.
You can get OSGi friendly versions of many common artifacts from the Spring bundle repository. So you may not have to do it yourself.
See details of how to configure the bundle repository for Maven.
(will update with some ideas for those that aren't available as bundles already)