Skip navigation
2012

One of the great advantages of working with open source software is the freedom of choice that it provides you. You aren't locked in by vendors or arcane licenses, you can choose the combinations of components that you want to work with. In doing so, however, you will likely have to invest time and effort in integrating these components to work together. Accomplishing these integration tasks can be difficult.

 

But, luckily, with JBoss Developer Studio, this integration work is already done for you. In JBoss Developer Studio, you have access to a rich JEE development environment that leverages JBoss technologies. JBoss Developer Studio provides graphical editors, integrations with source control systems, and  the ability to configure servers and deploy applications to them, all from inside an eclipse-based environment.


 

In the past, managing all these integrations required you to use multiple tools and actions. You could, however, do all these tasks without shutting down or leaving JBoss Developer Studio. That’s an important point to keep in mind as one of the goals of an IDE is to provide you with an environment in which you can perform development without having to exit the IDE to perform other common tasks such as staying up-to-date with new developments affecting the software with which you are working.

 

 

What was missing was a single utility to help you to access and stay up-to-date with JBoss technologies, news, examples and manage the specific plugins that you choose to install and use with JBoss Developer Studio.

 

The recent M5 ("milestone 5") build for JBoss Developer Studio 5 includes an answer to this problem: JBoss Central. 


 

(Note: This post is written from a Developer Studio perspective. JBoss Central, however, is also included in JBoss Tools.)

 

By default, JBoss Central is the first view that is displayed when you open JBoss Developer Studio. (OK, it’s really the second, after you get past a welcome view that has only one option - JBoss Central). But, JBoss Central is more than a welcome screen, it is a full featured "center of gravity" to assist you in both getting started with JBoss Developer Studio and in continuing and expanding your use of JBoss Developer Studio.

 

How is JBoss Central different from a welcome screen? In three important ways:


 

  • First, JBoss Central is dynamic, not static. You can receive updated news and blog content automatically through JBoss Central. In addition to informational content changes, new quickstart examples, and new wizards to create applications are pushed to you without you having to manually update or reconfigure JBoss Developer Studio.


  • Second, JBoss Central is active, not passive. JBoss Central can perform administrative tasks for you such as resolving dependencies and installing necessary plugins and runtimes. 

 

  • And third, unlike a welcome screen that you might only use once and then discard, JBoss Central is a destination. It’s a place that you will return to frequently as you use JBoss Developer Studio to develop, debug, deploy, and test your applications.

 

Let’s take a quick tour of JBoss Central. JBoss Central is divided into two tabs: Getting Started and Software/Update

 

 

The Getting Started tab looks like this:


 

 

and includes these options:


 

  • Create Projects - These wizards walk you through creating new projects.
  • Project Examples - The “quickstarts” are fully functioning applications. The goals of the quickstarts are to both illustrate technologies and features, and to provide you with working code that you can expand on to build your own applications.
  • Settings - These control how JBoss Central itself functions. Right now, there’s only one option here; whether JBoss Central is shown at startup.
  • News - This is a feature that can save you some time, as it enables you to access news from within JBDS and not have to access an external news reader.
  • Blogs - This serves as a good compliment to the News feature in that the combination of the information from these features can keep you up-to-date on new developments related to JBoss projects and technologies.

 

 

The other tab, Software/Update, looks like this:


 

 

As its name implies, Software/Update enables you to install features into JBoss Developer Studio and then update them. By default, JBoss Developer Studio, is configured to enable you to install and update features for source control, testing, and web development. It’s worth noting that while Eclipse does already include features to install software and keep it up-to-date, Software/Update is a more visual and easier to use.

 

 

Now, let’s take a more detailed look at one way JBoss Central is more than a welcome screen. We’ll start by installing one of the quickstarts. We’ll use the simplest quickstart, helloworld:


 

 

And, here’s where JBoss Central becomes an active helper, and not a passive bystander. Instead of failing to install the quickstart because of the lack of an installed server runtime, JBoss Central determines which runtime is missing, and will download and install it for us. Note that these quickstarts illustrate features suported by JBoss’ new AS7 server (http://www.jboss.org/as7).


 

So, let’s be lazy and let JBoss Central downlaod and install the server for us:


 

 

Now, it’s a simple matter to deploy and run the quickstart:


 

 

We’ll do it through Maven:


 

 

Once the quickstart is installed, we start the server, deploy the quickstart, and, in the tradition of all helloworld applications, here’s the minimalist output:


 

 

To sum it up, while it’s still a work in progress, JBoss Central is more than a welcome screen or an “on-ramp,” it’s an active and dynamic center of gravity for JBoss Developer Studio and a place that you will want to return to again and again as you use JBoss Developer Studio.

 

References:

 

http://docs.jboss.org/tools/whatsnew/central/central-news-1.0.0.M4.html

 

https://community.jboss.org/wiki/EasyPluginInstallationFromJBossCentral

 

https://community.jboss.org/community/tools/blog/2011/12/18/learn-java-ee-6-quickly-using-jboss-central

snjeza

JBoss Source Lookup

Posted by snjeza Jan 24, 2012

The JBoss Tools Source Lookup plugin automatically adds a source attachment when debugging JBoss AS servers.

The plugin has been tested with JBoss AS 7.x and JBoss AS 6.1.

 

Installing the JBoss Source Lookup plugin

 

 

Note: Since JBoss Tools 3.3 Beta3 JBoss Source Lookup is available and part of JBoss Tools Maven integration.

No need to install JBoss Source Lookup from the temporary updatesite anymore.

 

  • call Help>Install New Software..., click the Add button and enter the following update site:

https://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/org.jboss.tools.as.sourcelookup.updatesite/

lookupblog1.png

Install the JBoss Tools Source Lookup category and restart Eclipse.

 

Using the JBoss Source Lookup plugin

 

 

The use and debugging of this plugin is demonstrated in the following screencast: Debugging JBoss AS server.

 

The JBoss Source Lookup plugin enhances source attachment in the following way:

 

  • archive file doesn't have to be in the maven classpath
  • archive file doesn't have to be included in the classpath (jbossweb-*.jar, for instance). The JBoss Source Lookup plugin will find a class within a JBoss AS distribution and, if it is a Maven artifact, the plugin will attach the corresponding source.
  • archive file doesn't have to be in the m2e index (jbossjts-4.16.0.Final.jar, for instance)

 

You don't have to add any JBoss AS Runtime to the classpath. I have added it in order to ensure the classes within the runtime are included in the Java Search and in order to be easier to add a breakpoint.

 

Debugging Apache Tomcat and Glassfish servers

 

The JBoss Source plugin can serve to debug other servers.

If a server includes mavenized archives, the JBoss Source container will find, download, and show source files.
I have tested the Apache Tomcat 7.0.25 and Glassfish 3.1.1.

 

If you want to debug Apache Tomcat and/or Glassfish, you have to do the following:

 

  • create some Apache Tomcat/Glassfish server

    lookupblog3.png

  • open the server editor

    lookupblog4.png

  • click Open launch configuration and select the Source tab

    lookupblog5.png

  • click the Add button and select the JBoss AS Source Container

    lookupblog6.png

  • JBoss AS servers will be automatically recognized and you can choose them by clicking a server
    As to other servers, you need to click the Choose Home button, select all the directories in which the server's archives are placed.

        If you debug Tomcat, you can choose $TOMCAT_HOME/lib.  When debugging Glassfish, you can choose $GLASSFISH_HOME/lib and $GLASSFISH_HOME/modules.
        You can add as many JBoss AS Source containers as you want.

lookupblog7.png

 

  • move a JBoss Source container(s) to the end (optional)

    lookupblog8.png

  • you can add a Server Runtime container to the project's classpath (optional)

    lookupblog9.png

  • start the server in the debug mode

    lookupblog10.png

    StandardWrapper.java is placed in the glassfish's web-core.jar.  
    The Source Lookup plugin finds this archive's source and shows it in the editor.

 

In a similar way you can debug Apache Tomcat server.

lookupblog12.png

The ApplicationFilterChain.java is placed in the Tomcat's catalina.jar archive.

 

 

The Source Lookup plugin finds source for a mavenized archive as follows:

 

  • using the m2e API
  • using the archive's metadata (META-INF/maven)
  • using nexus repositories that can be defined using the Source Lookup preferences page

    lookupblog11.png

 

The Source Lookup preferences page enables you to add/remove, enable/disable and/or change ordering of Nexus repositories.

You can see that the helloworld project I have used in this blog, is not a maven project (it doesn't contain the maven icon).
JBoss Source Lookup plugin can be used to debug any Java project.

 

The plugin doesn't have to be used for debugging only.

It will find, download and open a source file for a mavenized archive included in the classpath when double-clicking a class file in the Package Explorer view, opening it using Navigate>Open Type or some other way.

 

The JBoss Source Lookup plugin can be used for any Java project and any launch configuration.

 

Note: When starting debugging the first time, it could take some time until m2e updates indexes and the JBoss Source lookup plugin scans the container's directory.

While everyone except me is having fun at JUDCon in India I thought it would be nice to let you know that there will be a few talks done by us/related to JBoss Tools in the near future elsewhere.

 

FOSDEM - 4-5. February, 2012, Brussels, Belgium

http://fosdem.org/2012/sites/all/themes/fosdem/images/logofosdem2.jpg

 

First up is FOSDEM in Brussels where there is a whole jboss.org DevRoom track of great talks, especially:

 

"JBoss Forge / Arquillian: Two Missing Links in Enterprise Java Development" by Koen Aers on Saturday, 4th February 2012 at 15:00.

 

Expect Koen to do show magic with his Forge Tooling which makes Forge and Eclipse work for you instead of against you.

 

EclipseCon, 26-29th March, 2012, Richmond Virginia

http://www.eclipsecon.org/2012/sites/all/themes/themes/econ2012/images/logo.png

 

This year EclipseCon is moving from "sunny" California on the west coast to Virginia on the east coast. Looking forward to see how the change of scenery will affect the conference.

 

"What's new in the OSGi Enterprise Release 5.0" by David Bosscheart (Red Hat) and Tim Diekmann (Tibco) on Tuesday, 27th March 2012 at 11:15

 

"Tycho - still good, bad or ugly ?" by Max Rydahl Andersen on Tuesday, 27th March 2012 at 16:15

 

"Ceylon - The language and it's tools" by Max Rydahl Andersen on Thursday, 29th March 2012 at 10:15

 

MOW2012, 18-20th April, 2012, Billund, Denmark

http://mow2012.dk/images/mow2012/images/logo_transparent.png

For the second year Miracle Open World which before was a dominantly "Oracle Database" conference is having tracks that includes other languages and especially Java middelware content. I was there last year and it was awesomely fun, even though very few had realized it was more than a database conference.

 

This year I and a few others from Red Hat will be presenting again so hope more will join in on the fun.

The following are the ones related to JBoss Tools, and titles being self-explanatory:

 

"Ceylon - say more, more clearly" by Max Rydahl Andersen on Thursday, 19th April 2012 at 11:00

 

"Death of the slow: 7 reasons to love AS 7" by Max Rydahl Andersen on Thursday, 19th April 2012 at 15:00

 

"JavaEE on the Cloud with OpenShift Express" by Thomas Heute on Friday, 20th April at 11:00

 

See you out there having fun!

We were quite busy up to the holidays getting JBoss Tools 3 M5 out and as a new year gift we updated our early access site for JBoss Developer Studio with its M5 release.

 

https://community.jboss.org/servlet/JiveServlet/showImage/38-2030-10503/earlyaccess.png

 

JBoss Developer Studio is Red Hat's full fledged Eclipse based IDE which is freely available in its standalone version (i.e. without JBoss Enterprise Application Platform) and

the same goes for this milestone 5 release - it is freely available from http://devstudio.jboss.com/earlyaccess.

 

Noticable changes in JBoss Developer Studio M5 are:

 

Universal Installer

We now provide an universal installer that works on all our supported platforms (and then some). This means you no longer have to consider which of the many OS specific installers we provide. You now just download the universal installer, run it and the installer will figure out which OS you are running and install the OS specific bits as needed.

 

JBoss Central

It is now even easier to get started using Developer Studio with JBoss servers via JBoss Central and if you are interested in latest news JBoss Central will give that too.

 

http://docs.jboss.org/tools/whatsnew/images/jboss-central-create-projects.png

Of course if you do not like it and every startup you can just disable the auto-startup and just open it whenever you wish too via the JBoss icon in the toolbar.

 

You can also use JBoss Central Software/Update page to install additional features and 3rd party plugins such as JRebel, FindBugs, SVN and others.

 

 

OpenShift

You can now create OpenShift applications directly from Developer Studio and get developing with Java EE and other OpenShift technologies in the cloud.

 

 

And more...

We've continued to fix bugs and integrate more of the new features found in JBoss Tools plugin set.

 

You can see more about those here and you can download Developer Studio 5 M5 from here

 

Have fun!

While developping web applications, it's common best practice to minify (and sometimes obfuscate) static resources such as javascript and css files.

Such resource processing can be done either at build time or at run time, depending on the tools you're using.

Surprisingly, tooling and documentation is rather scarce when it comes to web resource optimization in the Eclipse World.

On the other hand, maven has a wide variety of plugins wrapping around well-known 3rd party optimizers. In particular, Web Resource Optimizer for Java, a.k.a WRO4J is a :

 

"Free and Open Source Java project which brings together almost all the modern web tools: JsHint, CssLint, JsMin, 
Google Closure compressor, YUI Compressor, UglifyJs, Dojo Shrinksafe, Css Variables Support, JSON Compression, 
Less, Sass, CoffeeScript and much more. In the same time, the aim is to keep it as simple as possible and as 
extensible as possible in order to be easily adapted to application specific needs."

http://code.google.com/p/wro4j/

 

While WRO4J can be used at runtime, it also provides a maven plugin if you prefer a build time approach : wro4j-maven-plugin,.

 

Since Eclipse WTP allows you to incrementally deploy changed resources in your workspace directly to your prefered application server,

having a way to do on-the-fly resource optimization deployment would be great, wouldn't it?

 

Now, m2e (the Maven Integration for Eclipse plugin) users probably know, or will know soon enough, that m2e doesn't run maven plugins it doesn't know about. So having

 

<plugins>
  <plugin>
    <groupId>ro.isdc.wro4j</groupId>
    <artifactId>wro4j-maven-plugin</artifactId>
    <version>${wro4j.version}</version>
    <executions>
      <execution>
        <phase>compile</phase>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <targetGroups>all</targetGroups>
      <destinationFolder>${basedir}/src/main/webapp/wro/</destinationFolder>
      <contextFolder>${basedir}/src/main/webapp/</contextFolder>
    </configuration>
  </plugin>
</plugins>

 

would result in the dreaded "plugin execution not covered" error. Indeed, since Eclipse is all about incremental building (i.e. builds modified resources as soon as they're saved),

triggering long-running maven plugin every time a file is changed in the workspace would be a disaster. So m2e requires users to be explicit about what maven plugins should be run and when.

As a consequence, in order for these unknown plugins to be run on incremental builds, users need to modify their project pom.xml (or their parent pom.xml) and add a lifecycle-mapping configuration like (in the case of wro4j) :

 




<pluginManagement>

<plugins>
    <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
    <plugin>
        <groupId>org.eclipse.m2e</groupId>
        <artifactId>lifecycle-mapping</artifactId>
        <version>1.0.0</version>
        <configuration>
            <lifecycleMappingMetadata>
                <pluginExecutions>
                    <pluginExecution>
                        <pluginExecutionFilter>
                            <groupId>ro.isdc.wro4j</groupId>
                            <artifactId>wro4j-maven-plugin</artifactId>
                            <versionRange>[1.0,)</versionRange>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </pluginExecutionFilter>
                        <action>
                            <execute/>
                        </action>
                    </pluginExecution>
                </pluginExecutions>
            </lifecycleMappingMetadata>
        </configuration>
    </plugin>
    ...
</plugins>

 

Eventually, that lifecycle mapping would execute WRO4J on each and every file change in your project. That's a bit extreme, but the biggest problem is the generated files wouldn't be synchronized with the workspace so wouldn't be deployed automatically on a WTP server.

 

Here comes the m2e-wro4j connector : it's an eclipse plugin (in its early phase) that :

  • doesn't need the extra wro4j-maven-plugin lifecycle mapping
  • allows wro4j-maven-plugin to be invoked when .js, .css, .coffee, .less, .scss files are modified. Modifying the pom.xml also triggers the m2e-wro4j connector.
  • is always invoked on clean builds
  • updates the output folders so the changes can be visible directly in Eclipse and deployed directly via WTP if needed
  • automatically translates ${project.build.directory}/${project.build.finalName}/ output directories to ${project.build.directory}/m2e-wtp/web-resources/ if m2e-wtp is detected
  • Provides a wro4j-maven-plugin template, available on ctrl+space in the pom editor, in the <plugins> section :

wro4j-template.png

Using the above wro4j-maven-plugin configuration, and provided you have an wro.xml descriptor under src/main/webapp/WEB-INF, you can see in the following example the 2 css files are combined and minified into one all.css file under /target/m2e-wtp/web-resources/resources/styles/ and the javascript file is minified under /target/m2e-wtp/web-resources/resources/styles/all.js

wro4j-optimization.png

 

If you're interested in trying m2e-wro4j, you can install it from the following p2 update site : http://download.jboss.org/jbosstools/updates/m2e-wro4j/

 

 

Please be aware this initial version is really in its alpha stage (was coded in a day). Issues can be opened at https://github.com/jbosstools/m2e-wro4j/issues

 

For all your WRO4J or wro4j-maven-plugin specific issues, I strongly encourage you to :

 

Hope it helps.

 

19/01/2012 Important update : the github repo was transfered to the jbosstools organization under https://github.com/jbosstools/m2e-wro4j/. You must manually update your upstream repository url.

 

Fred

Filter Blog

By date:
By tag: