DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Mastering Time Series Analysis: Techniques, Models, and Strategies
  • MLOps: Definition, Importance, and Implementation
  • Getting Started With the YugabyteDB Managed REST API
  • Microservices Decoded: Unraveling the Benefits, Challenges, and Best Practices for APIs

Trending

  • Mastering Time Series Analysis: Techniques, Models, and Strategies
  • MLOps: Definition, Importance, and Implementation
  • Getting Started With the YugabyteDB Managed REST API
  • Microservices Decoded: Unraveling the Benefits, Challenges, and Best Practices for APIs
  1. DZone
  2. Coding
  3. Frameworks
  4. Comfortable GWT Debugging Using Eclipse

Comfortable GWT Debugging Using Eclipse

Ladislav Gažo user avatar by
Ladislav Gažo
·
May. 27, 10 · Interview
Like (0)
Save
Tweet
Share
16.17K Views

Join the DZone community and get the full member experience.

Join For Free

This tip describes comfortable ways of debugging Google Web Toolkit (GWT) applications using various configurations of launchers using Eclipse, m2eclipse and the Google Eclipse Plugin.

Usage of codehaus GWT-maven plugin is divided to two alternatives - one using GEP launch configuration and one using standard Java launch configuration. Needed tools:

  • Eclipse
  • maven
  • m2eclipse plugin
  • (first alternative) Google Eclipse Plugin for GWT 1.6+ projects
  • sample or your own complex structure of multimodule maven project

The tutorial will use sample structure to describe setup of whole project in Eclipse with possibility to automatically propagate change in source files of dependent modules to final GUI. The sample structure is prepared for extending with new use cases.

Let's consider simplified scenario of one framework module and one customer's web portal.

  • Framework module (fw1-mod) can be used by different portals in combination with different modules
  • Framework module is developed by us and it is reflecting common behaviour used in these portals
  • Customer's portal (cust-war) has also it's own shared module (cust-common) of common customer's behaviour
  • Framework module is more generic, customer shared module is specific only to that customer
  • framework module is located in java/fw1/fw1-mod
  • customer's portal is located in web/cust-portal/cust-war

This step is common for both alternatives - import projects into Eclipse using m2eclipse facilities.

  • File → Import → Maven → Existing Maven Projects
  • import fw1-mod, fw1-parent, cust-parent & cust-war
  • ensure that Workspace resolution is enabled

Generating Launch configuration

Steps needed to generate one of the launch configurations are as follows:

  • if you don't want to change the structure of your project to structure required by GWT 1.6 you will use standard Java launcher
    • mvn -Duse.google.eclipse.plugin=false gwt:eclipse
  • if you have GWT 1.6 compatible structure you can use GEP
    • mvn gwt:eclipse
  • there will be a launch configuration generated e.g. sk.seges.mmi.cust.Universe.launch
  • copy it to .metadata/.plugins/org.eclipse.debug.core/.launches directory of your workspace
  • re/start eclipse

Google Eclipse Plugin Launch configuration

Just search the launch configuration in Eclipse and run it. All dependencies are resolved automatically and GEP is copying a change transparently. If you take a look on the classpath GEP has it will be the same as the one you would setup for Java App. launch configuration.

Java App. Launch configuration

For non-GWT 1.6 projects the hardest part, modification of the classpath of the launch configuration:

  • open launch configuration
  • follow these steps as described here
    • select “Classpath” tab
    • select “User Entries”
    • press “Advanced”
    • select “Add folder”
      • for each project that cust-war is dependent of add its source/resource directories
  • these dependencies must be before “cust-war (default classpath)” so the hosted mode can recognize direct change - see

Such launch configuration can be reused and doesn't need modification until dependency change. It is running hosted mode directly. If all dependent module classpaths are not before cust-war default classpath hosted mode doesn't know of the change and reinstall or clean of that changed project is needed.

Final word

With any launch configuration you can do following:

  • run hosted mode with launcher
  • modify e.g. a string in Location class in fw1-mod
  • press Ctrl+S in Eclipse
  • press Refresh button in hosted mode
  • voila! change appears
Eclipse

Opinions expressed by DZone contributors are their own.

Trending

  • Mastering Time Series Analysis: Techniques, Models, and Strategies
  • MLOps: Definition, Importance, and Implementation
  • Getting Started With the YugabyteDB Managed REST API
  • Microservices Decoded: Unraveling the Benefits, Challenges, and Best Practices for APIs

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: