Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Give me a starting point for a complete beginner

Mikhail,
thx for your answer. I was able to resolve a few issue already; but now I am again stucking. A few dependencies I resolved with installing them from an "Orbit" archive, this had been mostly bindings to Apache Commons. 
I learned that I have to install these P2 bundle by using "Help / Install new software". But anyway hard to find the right bundle and sometime mostly impossible.

Now I am concretely stucking with dependencies to:

- org.eclipse.dltk.core.tests
- org.sourceforge.jsonedit.core
- org.json.simple

And my problem is just:

1) which are the bundles, how to find the bundles ?
2) And do I really need to do all this? In maven you just have to drop the group/artifact id and voila ?

best

Carsten


Am 23.06.2014 um 12:26 schrieb Mikhail Kalkov <mikhail.kalkov@xxxxxxxxxxxxxx>:

Hi,

I think Alex covered it all from a general viewpoint so I'll just fill in answers for your specific questions.

> So as far as I understood we have 2 different builds systems ? One is "Eclipse internal" one and the other is Maven (or Tycho over Maven).
Yes, "Eclipse internal" one is called PDE build. PDE build has one target platform per workspace, it has a built-in ECJ java compiler and a built-in Maven version. On the other hand, Tycho build uses whatever Maven instance you start, and had one target platform per maven module. Tycho also comes with it's own version of ECJ java compiler.

Dependencies are always resolved from target platform, which in case of Tycho may include both p2 and maven repositories, although one should strive to avoid dependencies not from p2 repos. In case of PDE, target platform may include p2 repositories as well as other eclipse installations. In order to add "org.apache.commons.exec" or any other bundle to the target platform, you should try to add a p2 repo with it to the target platform. Commons Exec happens to be available via Eclipse Orbit p2 repos (https://www.eclipse.org/orbit/). If it wasn't you would have few alternatives: (1) use pom-first dependencies suggested by Alex, (2) add a jar to your project, (3) add source code to your project, or (4) make an OSGi bundle from the jar and publish it to a p2 repo.

> The next I do not understand where the repository actually is?
You probably already know how a Maven repos looks like on hard drive, so I'll skip this part. A p2 repository is usually two files: {content,compositeContent}.{jar,xml} and {artifacts,compositeArtifacts}.{jar,xml}. The first file is also called a metadata repo, and the second file is sometimes known as artifact repo. These two files usually lay next to each other and are accompanied by features/ and plugins/ folders which contain the actual jars. So, in the end of a day, when somebody refers to a p2 repo, they very often mean a directory with content.xml, artifacts.xml, features/ and plugins/. Also, I suggest you think of p2 as of rpm or dpkg system since it's more about managing various Installable Units (features, plugins, plugin fragments etc.) than just being a passive repository.

Finally, I haven't used m2e a lot, but I guess that when you run a maven goal it relies on Tycho, whereas PDE build is still used to resolve many dependencies in Eclipse editor. I think m2e integrates with PDE and may be able to configure it to a certain degree to resolve everything correctly but I'm not sure how well it works in practice since I don't have first-hand experience.


Kind regards,
Mikhail Kalkov

Eclipse Developer | Purple Scout AB | www.purplescout.com
Kyrkogatan 20-22, SE-41110 Gothenburg, Sweden


On Fri, Jun 20, 2014 at 11:34 AM, Alex Blewitt <alex.blewitt@xxxxxxxxx> wrote:
This means you don't have apache commons exec in your eclipse target (typically your workspace if you've not configured it otherwise). Without it PDE will complain, although Tycho will be able to resolve it if you have pomDependencies=consider


Once you have installed it into your workspace you will have the bundle and so the problem will go away. You can install it via the host OSGi console in Eclipse with "install http://repo.maven.org/..." or just install your plugin built by maven/Tycho which will drag it in. 

You should check out the Tycho sample projects at https://github.com/eclipse/tycho-demo which show examples. 

I also wrote a book which covered Tycho in chapter 9; the source code is available on GitHub (each chapter is it's own branch)


Alex

Sent from my iPhone 5

On 20 Jun 2014, at 06:55, Carsten Harnisch <carsten.harnisch@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

Nick, 
thanks for your answer. Please excuse my stupid questions, but I am pretty new to this kind of system.
I also attached a screenshot.

So as far as I understood we have 2 different builds systems ? One is "Eclipse internal" one and the other is Maven (or Tycho over Maven).
When I do a Maven build (from the cmd line) I am getting a success, that would be same if I explicitly run Maven built in Eclipse (so right click on the project and "run as", "maven install"). But anyway the errors as in the screenshot stay as they are. You see this a dependency to "org.apache.commons.exec".

I just assume that is something completely different system, so here are the "errors" coming from the Eclipse internal build system and NOT the onces from the maven build ? Or does Tycho "replace" the Eclipse Build system ?
In my understanding I can use maven for the headless build (or on the command line) or in a CI environment. But for developing (and debugging) I would use the Eclipse build system. So at the end both ways should work ?

The next I do not understand where the repository actually is? So in maven I am ending with a folder on the local disk with all the (dependencies) artifacts stored into. For the P2 how this is working ? And more pragmatically: How I can get the needed jars (apache-commons) and where to put them? Or this there a way that I can just Tycho does this for me; aka reusing the maven repo for this?

I was just wondering that these things are so complicated and just seeing that I had passed the last couple days with this issue without writing a single line of code. So I assume there is maybe just something missing in the config and then the things are solving magically :)

Mit herzlichem Gruss / Kind Regards

Carsten Harnisch
Harnisch-Consulting

Yilmaz Türk Cad. 52
TR-34970 Istanbul / Adalar

Tel: +90 216 3823 678 (Asia)
Tel: +90 212 2450 648 (Europe)

<Bildschirmfoto 2014-06-20 um 08.19.27.png>

Am 19.06.2014 um 18:35 schrieb Nick Boldt <nickboldt@xxxxxxxxx>:

If you look in Window > Preferences > Maven > User Settings, do you see the same settings.xml and ~/.m2 folder that your commandline mvn build used?

If it's different, that might be why commandline resolves deps but in-Eclipse builds do not.

"p2" has been said to stand for a lot of things, from "Pascal's Provisioning" to "Provisioning Platform". It's also been said that it's called p2 because it sounds a little like someone spitting something out, ie., ptooey :D

http://eclipse.dzone.com/articles/understanding-eclipse-p2-provi
http://www.urbandictionary.com/define.php?term=ptooey


On 06/19/2014 09:15 AM, Carsten Harnisch wrote:
I am a beginner with Eclipse plugin development and trying a bit around how things are working.

The main issue is how to connect the maven repo to be used for the eclipse build.

Basically I would like to "build" first an already existing project. But I am lost with then "tycho" configuration.
I started with a "standard Eclipse Kepler" install and added "m2eclipse"
So what I did is "git clone" the project and then "import maven project" in Eclipse.

On the command line (e.g. a mvm install) runs well. Also a "run as" for maven install in eclipse does the right thing.

The problem is basically that the projects in Eclipse won't build, giving always the error, that dependencies are missing. These dependencies are mostly from org.apache.commons.XXX and are referenced in the manifest.mf.

So as far as I understand right now:

- Eclipse Build and Maven Build are using 2 different repositories for dependencies
- Eclipse Build is using a "P2 Repo" (for whatever stands P2 ?)

So my question is how to bring this together, thus how I can have "Eclipse" use the Maven repository, or is there another way to fix the problem ?
So do people just use tycho (so maven build) and ignore the Eclipse build system ? But then how I can debug from out of Eclipse ? So maybe there is just a missing plugin, or configuration ?

all help appreciated

Carsten
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


--
Nick Boldt :: http://nick.divbyzero.com
_______________________________________________
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

_______________________________________________
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