Default configurations for Eclipse-WTP plugin on dependent jar

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Default configurations for Eclipse-WTP plugin on dependent jar

aaschmid
Hi dev@gradle,

we recently have discovered some problem with dependent "jar" projects
for a "war" project, such that

1. Eclipse does not recognize it due to missing jst.utiltiy facet
2. The "Deployment Assembly" will get all the dependencies of the
project but by default just the dependencies of "runtime" configurations
should apply.

I have already made some patches for this, but no further tests
currently, see
https://github.com/aaschmid/gradle/tree/default.config.of.eclipse-wtp.for.jar.
I have tested with a project in question by creating an own gradle
version using the "install" task.


Now my questions:

1. Is there anything else to be aware of or can I just create a pull
request after implementing some tests?


2. Furthermore, I want to configure the "eclipse.wtp.facet" on my "jar"
project but I need to use "gradle.projectsEvaluated" (see also my
comment:
http://forums.gradle.org/gradle/topics/wtp_elipse_requires_ear_or_war_i_need_wtp_to_build_ejb_modules_but_i_dont_want_an_ear_artifact#reply_14825115).
This is required because in
"org.gradle.plugins.ide.eclipse.EclipseWtpPlugin" all the configuration
is done in "doLaterWithEachDependedUponEclipseProject(Project)". I have
tried to remove the "project.gradle.projectsEvaluated" closure but has
not helped. Even worse, this causes the "eclipse.wtp.facet" to be not
configurated at all :-(

I have also tried to add a configuration for "JavaPlugin" not just
"WarPlugin" and "EarPlugin" but this causes the complete
"EclipseWtpPlugin" to break down for "war"s (IMHO due to "WarPlugin"
also applies "JavaPlugin" and the ".withType" is always executed first
for "JavaPlugin", not for "WarPlugin" if available).


I am really curious to get further information about this. Also I would
be interessted in helping with the "Improved Tooling & IDE support" on
the roadmap.


Best regards,
Andreas





--
Andreas Schmid
Leonhardiweg 53
81829 München

Tel.: +49 176 10276440
Email: [hidden email]




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Default configurations for Eclipse-WTP plugin on dependent jar

Radim Kubacki
Hello Andreas,

On Wed, Oct 1, 2014 at 8:01 AM, Andreas Schmid - Service <[hidden email]> wrote:
Hi dev@gradle,

we recently have discovered some problem with dependent "jar" projects
for a "war" project, such that

1. Eclipse does not recognize it due to missing jst.utiltiy facet

I will need some time to look at this. Some things in WTP support are strange and it is complex area.
 
2. The "Deployment Assembly" will get all the dependencies of the
project but by default just the dependencies of "runtime" configurations
should apply.

I have already made some patches for this, but no further tests
currently, see
https://github.com/aaschmid/gradle/tree/default.config.of.eclipse-wtp.for.jar.
I have tested with a project in question by creating an own gradle
version using the "install" task.

If I understand correctly you want to make sure that dependencies like junit (coming from test/testRuntime configuratio) that are on a classpath of you library do not get added into your WAR. OTOH we would like to be able still run tests for that library project, right? If you patches address that then it would be welcome. 

Now my questions:

1. Is there anything else to be aware of or can I just create a pull
request after implementing some tests?

I believe accompanying your patch with a good test(s) will make your intent more obvious and it makes integration process easier. Thanks for your interest. 

2. Furthermore, I want to configure the "eclipse.wtp.facet" on my "jar"
project but I need to use "gradle.projectsEvaluated" (see also my
comment:
http://forums.gradle.org/gradle/topics/wtp_elipse_requires_ear_or_war_i_need_wtp_to_build_ejb_modules_but_i_dont_want_an_ear_artifact#reply_14825115).
This is required because in
"org.gradle.plugins.ide.eclipse.EclipseWtpPlugin" all the configuration
is done in "doLaterWithEachDependedUponEclipseProject(Project)". I have
tried to remove the "project.gradle.projectsEvaluated" closure but has
not helped. Even worse, this causes the "eclipse.wtp.facet" to be not
configurated at all :-(

I have also tried to add a configuration for "JavaPlugin" not just
"WarPlugin" and "EarPlugin" but this causes the complete
"EclipseWtpPlugin" to break down for "war"s (IMHO due to "WarPlugin"
also applies "JavaPlugin" and the ".withType" is always executed first
for "JavaPlugin", not for "WarPlugin" if available).


I am really curious to get further information about this. Also I would
be interessted in helping with the "Improved Tooling & IDE support" on
the roadmap.

We are at the point where we need to re-evaluate current integration and feedback like this definitely helps us better see what are common use cases.
 
-Radim

Best regards,
Andreas





--
Andreas Schmid
Leonhardiweg 53
81829 München

Tel.: <a href="tel:%2B49%20176%2010276440" value="+4917610276440">+49 176 10276440
Email: [hidden email]




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Default configurations for Eclipse-WTP plugin on dependent jar

aaschmid
Radim Kubacki wrote
> 1. Eclipse does not recognize it due to missing jst.utiltiy facet

I will need some time to look at this. Some things in WTP support are
strange and it is complex area.
Ok, maybe http://www.eclipse.org/webtools/development/proposals/WtpProjectFacets.html#_Jst.utility helps you a bit to understand it better.

Radim Kubacki wrote
> I have tested with a project in question by creating an own gradle
> version using the "install" task.

If I understand correctly you want to make sure that dependencies like
junit (coming from test/testRuntime configuratio) that are on a classpath
of you library do not get added into your WAR. OTOH we would like to be
able still run tests for that library project, right? If you patches
address that then it would be welcome.
Yes, you can configure the behavior such that every configuration you would like to add to "Deployment Assembly" can be, but the default behavior is to just add "compile" configuration. I will add some integration tests showing this.

Radim Kubacki wrote
> 1. Is there anything else to be aware of or can I just create a pull
> request after implementing some tests?

I believe accompanying your patch with a good test(s) will make your
intent more obvious and it makes integration process easier. Thanks for
your interest.
Ok, I will add some tests :-)

Radim Kubacki wrote
> 2. Furthermore, I want to configure the "eclipse.wtp.facet" on my "jar"
> project but I need to use "gradle.projectsEvaluated" (see also my
> comment:
>
> http://forums.gradle.org/gradle/topics/wtp_elipse_requires_ear_or_war_i_need_wtp_to_build_ejb_modules_but_i_dont_want_an_ear_artifact#reply_14825115
> ).
> This is required because in
> "org.gradle.plugins.ide.eclipse.EclipseWtpPlugin" all the configuration
> is done in "doLaterWithEachDependedUponEclipseProject(Project)". I have
> tried to remove the "project.gradle.projectsEvaluated" closure but has
> not helped. Even worse, this causes the "eclipse.wtp.facet" to be not
> configurated at all :-(
>
> I have also tried to add a configuration for "JavaPlugin" not just
> "WarPlugin" and "EarPlugin" but this causes the complete
> "EclipseWtpPlugin" to break down for "war"s (IMHO due to "WarPlugin"
> also applies "JavaPlugin" and the ".withType" is always executed first
> for "JavaPlugin", not for "WarPlugin" if available).
>
>
> I am really curious to get further information about this. Also I would
> be interessted in helping with the "Improved Tooling & IDE support" on
> the roadmap.
>

We are at the point where we need to re-evaluate current integration and
feedback like this definitely helps us better see what are common use cases.
What do you mean with that?

And can you answer the above question, how I could get rid of the "gradle.projectsEvaluated" surrounding the "eclipse.wtp..." configuration for my war-depended subprojects?
How can I help you understanding this problem, or is there the possibility to have a call using screen sharing etc.?

I really appreciate the fast answer, thanks for further help in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Default configurations for Eclipse-WTP plugin on dependent jar

aaschmid
aaschmid wrote
Radim Kubacki wrote
> 2. Furthermore, I want to configure the "eclipse.wtp.facet" on my "jar"
> project but I need to use "gradle.projectsEvaluated" (see also my
> comment:
>
> http://forums.gradle.org/gradle/topics/wtp_elipse_requires_ear_or_war_i_need_wtp_to_build_ejb_modules_but_i_dont_want_an_ear_artifact#reply_14825115
> ).
> This is required because in
> "org.gradle.plugins.ide.eclipse.EclipseWtpPlugin" all the configuration
> is done in "doLaterWithEachDependedUponEclipseProject(Project)". I have
> tried to remove the "project.gradle.projectsEvaluated" closure but has
> not helped. Even worse, this causes the "eclipse.wtp.facet" to be not
> configurated at all :-(
>
> I have also tried to add a configuration for "JavaPlugin" not just
> "WarPlugin" and "EarPlugin" but this causes the complete
> "EclipseWtpPlugin" to break down for "war"s (IMHO due to "WarPlugin"
> also applies "JavaPlugin" and the ".withType" is always executed first
> for "JavaPlugin", not for "WarPlugin" if available).
>
>
> I am really curious to get further information about this. Also I would
> be interessted in helping with the "Improved Tooling & IDE support" on
> the roadmap.
>

We are at the point where we need to re-evaluate current integration and
feedback like this definitely helps us better see what are common use cases.
What do you mean with that?

And can you answer the above question, how I could get rid of the "gradle.projectsEvaluated" surrounding the "eclipse.wtp..." configuration for my war-depended subprojects?
How can I help you understanding this problem, or is there the possibility to have a call using screen sharing etc.?
As there is still no answer on the above question, I have re-thought a lot about it and my conclusion are the following:

I think to move the configuration of "war" dependent "java" projects from on demand (as it is now) to always would solve a lot of problems. This means that the "eclipse-wtp" tasks and defaults of all the "war" and "ear" dependent "jars" are no longer configured after their corresponding "wars" and "ears" in a <code>gradle.projectsEvaluated</code> block. Instead configure the "eclipse-wtp" tasks and defaults for every "jar" or respecively "java" project to which it is applied immediately.

The benefits which I can think of now are:
* All the "eclipse-wtp" configuration for either "jars", "wars" or "ears" happens to the same time.
* Very much easier to understand and reconstruct what happens if you apply an "eclipse-wtp" plugin to a "java" project.
** Always the same, explicit behavior when applying "eclipse-wtp", not sometimes it has the "eclipse-wtp" artifacts and sometimes not because no "war" depends the "jar".
** If you don't want the artifacts, just do not apply the "eclipse-wtp" plugin and switch to "eclipse" plugin.
* It is very easy to configure/override defaults the "eclipse-wtp" for a "java" project similar to "wars" and "ears".

What do you think about it?

Reply | Threaded
Open this post in threaded view
|

Re: Default configurations for Eclipse-WTP plugin on dependent jar

aaschmid
I have opened my first two pull requests to this topic:

* https://github.com/gradle/gradle/pull/344
* https://github.com/gradle/gradle/pull/345

Can you please have a look at it and give me feedback?
Reply | Threaded
Open this post in threaded view
|

Re: Default configurations for Eclipse-WTP plugin on dependent jar

aaschmid