Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [january-dev] Maven support for January

And now for IntelliJ IDEA :

 

Opening the projects from the January root folder, and building everything as maven modules seems to work smoothly.

I have no experience with IntelliJ, and have some difficulties finding my way around in it, but the basic things seem to work as far as I can tell from this quick trial.

(opening from the January local git repo, getting maven to resolve everything, (re)building projects from IntelliJ menu, running)

 

I can run the examples from IntelliJ IDEA, from a plain Java main launch, e.g. for C1TheBasics.

 

 

 

Now what?

 

Regards

Erwin

 

 

From: january-dev-bounces@xxxxxxxxxxx [mailto:january-dev-bounces@xxxxxxxxxxx] On Behalf Of Erwin De Ley
Sent: Saturday, April 15, 2017 3:27 PM
To: january developer discussions <january-dev@xxxxxxxxxxx>
Subject: Re: [january-dev] Maven support for January

 

Hi Jonah,

 

I hadn’t yet used another IDE as I like Eclipse too much 😉

My statement was based on the fact that maven/tycho are made to be used outside of IDEs (e.g. also in Jenkins builds).

But now, to try it out for real, I installed Netbeans 8.2, forked/cloned January and tried to setup the January projects in Netbeans.

 

Netbeans is unaware of OSGi-related stuff but has native Maven support.

I.e. you just do “Open Project” and point to the cloned January root folder and also Open Required Projects :

 

 

The result is January projects in Netbeans. But…

 

With the current master version of January not all is well yet for this simple “open/import” process :

  • src folders are not recognized as January is not using the maven default (src/main/java ; src/test/java etc)
  • For some reason Netbeans assumes source level 1.5, I switched to 1.7 which I think is what you want to have for January?
  • Still missing dependencies in the poms (copied what was done in the PR of Yannick + some extras), both on 3rd-part things like Apache commons stuff, Junit
  • and also between January modules (e.g. you need to add dependencies on org.eclipse.january in the o.e.j.asserts pom etc)

 

That last thing is a bit annoying, but is necessary if you want to express dependencies in POMs (and not depend on Tycho’s MANIFEST-driven resolving).

It also leads to the need to do a local build & install to your local repo, before the dependant modules/projects find their module dependency.

 

I adapted all those elements in my clone and now have a clean Netbeans January workspace using POMs that contain Tycho stuff.

Netbeans compiles the projects nicely, but … (again )

 

Remaining gotchas :

  • A simple “Build” action on a January project fails with a mvn/tycho error that it can not find the target platform.

I always need to do a “Build with dependencies”, which does more and takes longer than what I would like (also generates Javadocs?).
I guess that could be improved by using a right profile to do workspace builds?

 

  • The usage of the tycho-buildtimestamp-jgit thing prevents doing a tycho build when there are uncommitted changes
  • Netbeans complains about using generic methods with type tokens and then invoking methods directly on the assumed/dynamic-casted return object.
    E.g. Dataset interElevations = (Dataset) meanTemperature.getFirstMetadata(AxesMetadata.class).getAxis(0)[0];
    The getAxis() method does not exist on MetaDataType, but does exist on AxesMetadata.
    For some reason Netbeans requires source level 1.8 to accept this syntax, while Eclipse is OK with 1.7…
  • And the worst one : Netbeans seems to be using a mvn build to run Java main classes as well, e.g. for the examples…

And I haven’t figured out yet how to get that working, so I can not run a simple Java main from my Netbeans … DAMN!

 

I’ll also try IDEA, maybe that one’s easier…

 

Cheers

erwin

 

 

From: january-dev-bounces@xxxxxxxxxxx [mailto:january-dev-bounces@xxxxxxxxxxx] On Behalf Of Jonah Graham
Sent: Friday, April 14, 2017 7:08 PM
To: january developer discussions <january-dev@xxxxxxxxxxx>
Subject: Re: [january-dev] Maven support for January

 

Erwin, 

 

Thanks for your insights. I am certainly concerned that we don't regress on our  current maven/tycho build of January when trying to build. Do you have any experience of using a maven/tycho project in other IDEs? 

 

Jay, 

 

Yes, forms has some extra challenges. Xtext has been making a lot of progress on supporting other IDEs and the non-UI parts of Xtext don't need OSGi. I am very keen on enabling those workflows. 

 

Neon.2 and Neon.3 platform are now fully published to maven, opening up a lot of great possibilities. 

 

Thanks for the feedback, 

Jonah

 

 

On 14 Apr 2017 4:39 p.m., "Jay Jay Billings" <jayjaybillings@xxxxxxxxx> wrote:

I don't know that a plain Maven build will work for the Forms part of January because of all the OSGi dependencies. I really like the idea of getting the bundles in Maven central though!

 

Jay

 

On Apr 14, 2017 11:30 AM, "Erwin De Ley" <erwin.de.ley@xxxxxxxxxx> wrote:

Hey Jonah,

Thanks for the detailed response.

I'm not sure if you want to spend more time on exchanging ideas/questions about this.
If not, just tell me so and I'll shut up 😉

But if still of interest, some more (probably trivial) info from our bit of experience in this :
- Tycho is not really related to using Eclipse IDE or not. It's just a set of Maven plugins, working from a cmdline mvn build as well, or in other IDEs with mvn support.
- Tycho also allows you to specify the dependencies inside your module poms, although it is by default "MANIFEST-first".
- A Tycho build is typically slower than  a plain Maven build, especially if you have many bundles/jars to build as it does a full bundle resolution step against your target for each of your bundle projects.
But for the rest it could be almost transparent to contributors (if they are on Maven 3).

One thing that might lead to issues when you start building January with a plain Maven build :
- With Tycho all dependencies must be real OSGi bundles as well, which is not needed for a plain Maven build. This is something that has hit us in the past.
E.g. when you assume in your Tycho build that you can take your dependencies from Maven Central, you need to be certain that they are available there as OSGi bundles.
Which is still not the case for lots of 3rd-party things. So you might have issues when you currently use an Eclipse/Orbit p2 to look for dependencies, and then try to switch to using Maven Central to find dependencies for your January builds.

Looking at it in the other direction : a working plain Maven build won't guarantee that the same POMs/build artifacts resolve correctly when integrating it in an OSGi application build.

Cheers
erwin


-----Original Message-----
From: january-dev-bounces@xxxxxxxxxxx [mailto:january-dev-bounces@xxxxxxxxxxx] On Behalf Of Jonah Graham
Sent: Friday, April 14, 2017 11:09 AM
To: january developer discussions <january-dev@xxxxxxxxxxx>
Subject: Re: [january-dev] Maven support for January

Hi Erwin,

TL;DR - January datasets is a "pure" Java library. We want to remove unneeded dependencies for contributors/adopters while continuing to make OSGi bundles available via P2.

----

Thanks for showing an interest in this tricky topic. I agree that it is not straightforward what we should do.

Our primary goal is to enable adopters to consume released January from whatever build system they want. At the moment we only release an Eclipse P2 site with bundles, and those bundles contain OSGi compatible MANIFEST.MF files. We want to make it easy to consume with Maven/Gradle/Ivy/etc. For this goal, the obvious place to publish bundles is maven central. It is the easy place to pull from any of the build systems. Even the Eclipse Project (aka Platform SDK) are now regularly publishing there.[1] This goal is being worked on (and nearly there) by Yannick, tracked in Issue #144[2].

This goal is in addition to the current published method of P2/OSGi.
No changes are planned there on how January can be consumed from P2 sites.

The secondary goal is to enable contributors to come up to speed faster with January. While we need real OSGi bundles, as they will continue to be consumed by Eclipse RCP applications (like Dawn, ICE,
etc) we don't require OSGi to use January and in the core datasets do not use any of OSGi. So the secondary goal becomes one of removing the implied dependencies on Tycho / Eclipse IDE as a dev environment. The best solution it seems to me is building January as a "pure" maven project (no tycho). Eclipse IDE could continue to open and "understand" the project using m2e[3], but contributors could use any other IDE of their choosing and develop January too. I have now created an issue, #165 to track this.

Thanks
Jonah



[1] http://dev.eclipse.org/mhonarc/lists/eclipse-dev/msg10352.html
[2] https://github.com/eclipse/january/issues/144
[3] https://www.eclipse.org/m2e/
[4] https://github.com/eclipse/january/issues/165
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com


On 13 April 2017 at 19:59, Erwin De Ley <erwin.de.ley@xxxxxxxxxx> wrote:
> Thanks Yannick, nice work!
>
>
>
> Could you explain where the issues are to keep a Tycho build to
> achieve this?
>
> Or is it because January does not and will not need to deliver “real”
> OSGi bundles and so doesn’t need the overhead of Tycho?
>
> (E.g. no use case for OSGi services?)
>
>
>
> Cheers
>
> erwin
>
>
>
> From: january-dev-bounces@xxxxxxxxxxx
> [mailto:january-dev-bounces@xxxxxxxxxxx] On Behalf Of Yannick Mayeur
> Sent: Thursday, April 13, 2017 4:08 PM
> To: january developer discussions <january-dev@xxxxxxxxxxx>
> Subject: Re: [january-dev] Maven support for January
>
>
>
> Hi Erwin, all,
>
>
>
> When we mention being available through Maven, we indeed mean through
> Maven Central.
>
> If you take a look at this: https://goo.gl/w2j3n2
>
> You can see that we already made us available on Maven Central using
> the current poms of the project with a few changes including adding
> the dependencies, so the end-user does not need to duplicate them.
>
> You can see what changes exactly were required if you take a look at
> my pull
> request: https://github.com/eclipse/january/pull/160
>
>
>
> Regards,
>
>
>
> Yannick Mayeur
>
>
>
> 2017-04-13 14:31 GMT+01:00 Erwin De Ley <erwin.de.ley@xxxxxxxxxx>:
>
> Hi Tracy, all,
>
>
>
> This is an interesting and tricky topic indeed.
>
>
>
> When you mention being available through Maven, is this about being on
> Maven Central and with standard poms including detailed dependency
> information? Is there some info available on the exact needs and
> issues you have with January in the two approaches?
>
>
>
> Regards
>
> erwin
>
>
>
> From: january-dev-bounces@xxxxxxxxxxx
> [mailto:january-dev-bounces@xxxxxxxxxxx] On Behalf Of Tracy Miranda
> Sent: Thursday, April 13, 2017 12:53 PM
> To: january developer discussions <january-dev@xxxxxxxxxxx>
> Subject: [january-dev] Maven support for January
>
>
>
> Hi all,
>
>
>
> Recently we have been looking at making January bundles easily
> available through Maven.
>
>
>
> Yannick Mayeur has been doing some great work on deploying bundles to
> Maven and providing an example project consuming January with maven:
> https://github.com/yannick-mayeur/mvnTestJanuary
>
>
>
> One of the things this work is highlighting is that it is proving
> problematic having both a Maven build and a Maven/Tycho build, with
> some issues to be resolved plus duplication of dependency information.
>
>
>
> It looks like the best way to solve these will be to switch over to a
> pure Maven build, then we are down a well-beaten track for many of
> these infrastructure issues.
>
>
>
> Tracy
>
>
> _______________________________________________
> january-dev mailing list
> january-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/january-dev
>
>
>
>
> _______________________________________________
> january-dev mailing list
> january-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or
> unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/january-dev
>
_______________________________________________
january-dev mailing list
january-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/january-dev
_______________________________________________
january-dev mailing list
january-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/january-dev


_______________________________________________
january-dev mailing list
january-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/january-dev

 


Back to the top