Skip navigation

On Friday, Windup 2.6.0.Final was released. Download at the Windup website.


There are 2 particular things to highlight:



Windup 2.6 can create a basic Maven project structure for your application. When you execute Windup with the --mavenize flag, Windup analyzes the structure of your application and creates POM files with the appropriate dependencies for each of your application modules.


Shared archives

If a big application contains same libraries or modules multiple times appear in multiple places in your input applications, and adjusts incident counts and effort estimates to avoid double-counting. If you analyze multiple applications together, Windup bundles information about the shared archives to present you with information on the common libraries shared across your applications.


Besides that, like always - performance improvement, bug fixes, design improvements, additional rules & rules fixes.



When you validate a XML file, and this has a XSD URL for some namespace, and this XSD URL redirects to another URL, then the default EntityResolver2 takes that as a failure.

Jess noticed (and fixed) this when debugging WINDUP-997.


So for instance, this XML was not valid, because some of the URLs (perhaps in the linked XSD's) is behind a redirect:


<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns=""

    <mvc:resources mapping="/resources/**" location="/" />



So here's a fixed implementation. It follows only a single redirect, but change the if to a for and it will follow more (don't forget to prevent infinite loop).


package org.jboss.windup.rules.apps.xml.xml;


import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.ext.EntityResolver2;

* This is an {@link EntityResolver2} that has been enhanced to support URL redirection.
 * @author <a href="">Jesse Sightler</a>
public class EnhancedEntityResolver2 implements EntityResolver2
  public InputSource getExternalSubset(String name, String baseURI) throws SAXException, IOException
  return null;

  public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
  return resolveEntity(null, publicId, null, systemId);

  public InputSource resolveEntity(String name, String publicId, String baseURI, String systemId) throws SAXException, IOException
  URL url = baseURI != null ? new URL(new URL(baseURI), systemId) : new URL(systemId);

  URLConnection connection = url.openConnection();

  // Not a HTTP connection... skip redirection logic
  if (!(connection instanceof HttpURLConnection))
  return new InputSource(connection.getInputStream());

  HttpURLConnection httpConnection = (HttpURLConnection)connection;

  int status = httpConnection.getResponseCode();
  if ((status != HttpURLConnection.HTTP_OK) &&
  (status == HttpURLConnection.HTTP_MOVED_TEMP
  || status == HttpURLConnection.HTTP_MOVED_PERM
  || status == HttpURLConnection.HTTP_SEE_OTHER))
  String newUrl = httpConnection.getHeaderField("Location");
  httpConnection = (HttpURLConnection) new URL(newUrl).openConnection();

  InputSource inputSource = new InputSource(httpConnection.getInputStream());
  return inputSource;



Filter Blog

By date:
By tag: