Bug 717526
Summary: | Revert filtering in server/jar | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Heiko W. Rupp <hrupp> | ||||||
Component: | Build System | Assignee: | Simeon Pinder <spinder> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | urgent | ||||||||
Version: | 4.1 | CC: | hrupp, skondkar | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2012-02-07 19:24:50 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 678340 | ||||||||
Attachments: |
|
Description
Heiko W. Rupp
2011-06-29 06:41:46 UTC
Actually it turns out, that ServerVersion.namespace is used in a lot of places as a constant , so using a method to obtain the namespace may be no option. A static class initializer may help here e.g. static { namespace = System.getProperty("pom.version"); } public static final String namespace; The CoreServer class in server-jar has an example of loading build properties from the classpath. There is also the MavenArtifactProperties class that I wrote, which provides the ability to load the standard maven build properties file for the specified Maven artifact, e.g.: MavenArtifactProperties richFacesMavenProps = MavenArtifactProperties.getInstance("org.richfaces.framework", "richfaces-api"); The static initializer approach from comment#1 is failing: modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceTypeAdapter.java:[25,46] attribute value must be constant The compiler sees that the "public static final String namespace" is only initialized in that initializer and not a real constant. Can we perhaps use some sed mechanics on release builds to replace the version and otherwise keep the String constant with some "dummy" value -- much like we do with the pom versions? Commit 6a75748bbe847d611f8ecdcf64b09134fde63340 makes this a bit less of an issue. Basically instead of doing resource filtering on the whole src/main/java, I split the code into "normal" and "filtered". The normal code lives under src/main/java and is your ordinary java sources with no special maven attention. The filtered sources live under src/filtered-sources/java and are subject to maven resource filtering. The filtered java files are put into target/filtererd-sources/java which is then set as an additional source directory. Effectively, the sources from src/main/java and target/filtered-sources/java then make up the full source tree and are compiled normally into target/classes. The advantage of this approach is three-fold: 1) There is a clear separation of source files that need special treatment. 2) The build only recompiles the filtered sources each time it is invoked (even if there were no changes to the source files). This is a big improvement over the former implementation that had to recompile all the sources in server jar each time a build was invoked. 3) Increased compatibility with the Eclipse maven plugin (m2e) that wouldn't handle well the change of the source directory and would force the user to actually edit files in the source directory (that was redefined to be in target) and thus the user would loose changes everytime a maven build would commence. The only special case left are the filtered source files but because it is made explicitly an exceptional kind of a source file, the developer is more easily aware of special treatment needed for it. -------------------------- To test this, we need to make sure the Web services still define the correct namespace. Simeon, could you please provide more feedback on how to actually do that? I know nothing about our web services infrastructure. confirmed web services by following these steps: http://www.rhq-project.org/display/JOPR2/RHQ+Web+Services+Installation and then visiting this URL: https://localhost:7443/jbossws/services this page defines an endpoint as follows: Endpoint Name jboss.ws:context=rhq-rhq-enterprise-server-ejb3,endpoint=WebservicesManagerBean Endpoint Address http://foleymonsterbox1.foleyhomenetwork:7080/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl but ... there is no WSDL at this location http://localhost:7080/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl (and I expect there would some WSDL) Simeon ... could you confirm that this is the correct behavior for web services? added BZ 726502 https://bugzilla.redhat.com/show_bug.cgi?id=726502 while trying to verify. discussed with spinder. verification of this BZ is blocked by BZ 726502. Created attachment 515903 [details]
screen shot of ws version still being correctly set after filter changes
Fixed BZ 726502 and verified that Webservice version is still being correctly set. See attached screenshot. Nice work Lukas. Moving to ON_QA. Verified on build#231 (Version: 4.1.0-SNAPSHOT Build Number: c4a82bc) 1. Followed the steps in: http://www.rhq-project.org/display/JOPR2/RHQ+Web+Services+Installation 2. Visited this URL: https://localhost:7443/jbossws/services 3. Clicked on: http://localhost:7080/rhq-rhq-enterprise-server-ejb3/WebservicesManagerBean?wsdl 4. Verified that the namespace in the WSDL is displayed as: "http://www.rhq-project.org/4.1.0-SNAPSHOT/Webservices.xsd" Please refer the attached screenshot. Marking as verified. Created attachment 516123 [details]
Screenshot
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE |