maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Imports of required classes have classname only without package path within the class compiled by maven
Date Fri, 25 Oct 2013 09:07:49 GMT
The web project composed of several modules can be deployed to the 
application server (WAS 8.5.5) and runs as expected, when built within 
eclipse (juno sp2) by the eclipse compiler. The same project built with 
maven, either through the m2e-wtp plugin or with "mvn clean install" from 
the command line, can not be run on the AppServer.

Maven build worked too, but does not anymore for unknown reason. No 
changes of configuration or programs but update of m2e-wtp.

All required configuration files bundled within the resulting project.ear 
are correct and identical to the version compiled with eclipse.
On analyzing the issue it turned out, some classes compiled by maven have 
defective import lists! 
For instance:
A *.class file decompiled with jd has the following import list:
import DocumentId;
import DocumentKind;
import IProject;
import IRequirement;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.logging.Logger;
import javax.faces.model.SelectItem;
We see, the list is truncated, and some imports have the class name only, 
but no package information.
If we look at the same decompiled class file, but the outcome from the 
eclipse compiler, the list look like:
import ch.commcity.monterosa.common.reports.DocumentId;
import ch.commcity.monterosa.common.reports.DocumentKind;
import ch.commcity.monterosa.ejb.IProject;
import ch.commcity.monterosa.ejb.IRequirement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.application.Application;
import javax.faces.application.ConfigurableNavigationHandler;
import javax.faces.application.FacesMessage;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
First, the latter list is longer and second the import DocumentId for 
instance  includes the full package path!
As the import list is defective, no surprise all methods look like the 
following example:
  int getFrom()
    throw new Error("Unresolved compilation problem: \n");
instead of:
int getFrom() {
        return this.from;
which is neither very sophisticated, but does was is expected to be done.
All dependencies declarations within the poms are the same as before. May 
a missing declaration be the origin of the problem, which before had no 
What else? I must say I had the same problem in February of this year, But 
without any conscious change (I suspect after update to sp2 of juno) it 
worked suddenly as now it stopped to work, maybe due to the m2e-wtp 
The poms are unchanged and within the Kepler IDE environment maven 
compiles the code as expected. The only differences are some parts proper 
to the glassfish 3.1.2 Appserver and for the Mojarra version of JSF in 
turn of MyFaces used by WebSphere.
Any hint or suggestion is welcome.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message