Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-1880

Eclipse task should warn the user when a web application relies on a module without eclipse-wtp plugin applied

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Resolution: Unresolved
  • Affects Version/s: 1.0-milestone-5
  • Fix Version/s: None

Description

The Eclipse task should warn the user when a web application module ("java", "war", "eclipse-wtp" plugins applied) relies on a module without wtp plugin applied ("java", "eclipse" plugins applied).

When a Java web application module A depends on a module B which doesn't have the eclipse-wtp plugin applied, the dependency will be added correctly in A but the necessary files wtp configuration files wont be created in module B. Both module A and B are created as valid eclipse projects, and module A will have a correct dependency on module B and all resources (classes, etc) will be shared correctly between the projects in eclipse. The deployment descriptor for module A in the WTP integration will however be invalid which means that module B will not correctly be deployed when using the WTP servlet container integration.

It may be fair to emit a warning when running the eclipse task that module A depends on a module that does not have the eclipse-wtp plugin applied (but has the eclipse plugin applied). It may also be fair to note in the documentation that the eclipse-wtp plugin is not only used for modules applying the "war" plugin, but should also be applied to modules that these modules depend on.

I've attached a simple example which illustrates the problem.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    gradle-eclipse-wtp.zip
    01/Nov/11 10:07 AM
    7 kB
    Sune Wettersteen
    1. File
      build.gradle 0.3 kB
    2. File
      settings.gradle 0.0 kB
    3. File
      shared-code/bin/.../SomeTestClass.class 0.4 kB
    4. File
      shared-code/build.gradle 0.1 kB
    5. Java Source File
      shared-code/src/.../SomeTestClass.java 0.1 kB
    6. File
      web-application/.../ContextListener.class 1 kB
    7. File
      web-application/build.gradle 0.3 kB
    8. Java Source File
      web-application/src/.../ContextListener.java 0.9 kB
    9. XML File
      web-application/src/.../WEB-INF/beans.xml 0.9 kB
    10. XML File
      web-application/src/main/.../WEB-INF/web.xml 0.8 kB
    Download Zip
    Show
    Zip Archive
    gradle-eclipse-wtp.zip
    01/Nov/11 10:07 AM
    7 kB
    Sune Wettersteen

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Kris De Volder added a comment - 04/Jan/12 4:21 PM

This is quite a devious problem... projects that have this problem look 'ok' in every way, yet they don't deploy properly. It would be quite hard for a user to determine what the problem is.

I've added my vote for this issue, i.e. I think it would be very good if there would be some kind of error/warning to explain to a user it isn't a good idea to have WTP projects depending on non-WTP projects.

Example of a problem caused by this issue that was reported as a bug against STS gradle tooling:
https://issuetracker.springsource.com/browse/STS-2192

Show
Kris De Volder added a comment - 04/Jan/12 4:21 PM This is quite a devious problem... projects that have this problem look 'ok' in every way, yet they don't deploy properly. It would be quite hard for a user to determine what the problem is. I've added my vote for this issue, i.e. I think it would be very good if there would be some kind of error/warning to explain to a user it isn't a good idea to have WTP projects depending on non-WTP projects. Example of a problem caused by this issue that was reported as a bug against STS gradle tooling: https://issuetracker.springsource.com/browse/STS-2192
Hide
Permalink
Szczepan Faber added a comment - 10/Mar/12 3:48 PM

So Kris, will you be happy with just a warning emitted to the console?

Show
Szczepan Faber added a comment - 10/Mar/12 3:48 PM So Kris, will you be happy with just a warning emitted to the console?
Hide
Permalink
Kris De Volder added a comment - 13/Mar/12 2:37 PM - edited

I guess so. Unless there is another / better way.

For now it will have to do. In the longer term perhaps we should start putting some thought into ways that Gradle models pr task executions could attach error and warning markers to resources in the project (i.e. create a concept similar to Eclipse's marker in Gradle tooling API).

Show
Kris De Volder added a comment - 13/Mar/12 2:37 PM - edited I guess so. Unless there is another / better way. For now it will have to do. In the longer term perhaps we should start putting some thought into ways that Gradle models pr task executions could attach error and warning markers to resources in the project (i.e. create a concept similar to Eclipse's marker in Gradle tooling API).
Hide
Permalink
Szczepan Faber added a comment - 13/Mar/12 4:40 PM

This something that could be modelled explicitly at some point. You'd get some kind of Warning object that contains useful information - for example the stuff you mentioned (resource name, line number, etc).

Show
Szczepan Faber added a comment - 13/Mar/12 4:40 PM This something that could be modelled explicitly at some point. You'd get some kind of Warning object that contains useful information - for example the stuff you mentioned (resource name, line number, etc).

People

  • Assignee:
    Unassigned
    Reporter:
    Sune Wettersteen
Vote (5)
Watch (4)

Dates

  • Created:
    01/Nov/11 10:07 AM
    Updated:
    13/Mar/12 4:40 PM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.