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-1377

gradle Eclipse plugin should allow simple method to set jst.web value

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Resolution: Unresolved
  • Affects Version/s: 0.9.2
  • Fix Version/s: None

Description

When building eclipse project files, gradle eclipse always defaults to setting jst.web to 2.4, which is YEARS old. There should be a simple way to set this.

A workaround is given here:

http://eqv.ca/research/2010/12/26/gradle-and-eclipse-wtp-jst-web-facet-version

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Umit added a comment - 08/Sep/11 8:55 PM - edited

The provided workaround needs a little modification as of version 1.0-milestone-3.
Just change 'eclipseWtp' to 'eclipseWtpFacet', so that it should be:

eclipseWtpFacet.whenConfigured { config ->
    config.facets.each {
        if (it.name == 'jst.web') {
            it.version =
                configurations.providedCompile.getAllDependencies().find{
                    it.group == 'javax.servlet' && it.name == 'servlet-api'
                }.version
        }
    }
    config.facets.unique()
}
Show
Umit added a comment - 08/Sep/11 8:55 PM - edited The provided workaround needs a little modification as of version 1.0-milestone-3. Just change 'eclipseWtp' to 'eclipseWtpFacet', so that it should be:
eclipseWtpFacet.whenConfigured { config ->
    config.facets.each {
        if (it.name == 'jst.web') {
            it.version =
                configurations.providedCompile.getAllDependencies().find{
                    it.group == 'javax.servlet' && it.name == 'servlet-api'
                }.version
        }
    }
    config.facets.unique()
}
Hide
Permalink
Umit added a comment - 13/Nov/12 9:49 PM

In gradle Milestone 6, whenConfigured is deprecated. Here's an updated solution:

eclipse {
    wtp {
        facet {
          file {
            whenMerged { config ->
                config.facets.each {
                    if (it.name == 'jst.web') {
                        it.version = 3.0 
                    }   
                }   
                config.facets.unique()
            }   
          }   
        }   
    }   
}
Show
Umit added a comment - 13/Nov/12 9:49 PM In gradle Milestone 6, whenConfigured is deprecated. Here's an updated solution:
eclipse {
    wtp {
        facet {
          file {
            whenMerged { config ->
                config.facets.each {
                    if (it.name == 'jst.web') {
                        it.version = 3.0 
                    }   
                }   
                config.facets.unique()
            }   
          }   
        }   
    }   
}

People

  • Assignee:
    Unassigned
    Reporter:
    Daniel Joyce
Vote (2)
Watch (2)

Dates

  • Created:
    06/Feb/11 1:39 PM
    Updated:
    13/Nov/12 9:49 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.