[jbosstools-issues] [JBoss JIRA] (JBIDE-10401) externalize URL for Central directory.xml file so it can be passed in via commandline when building or at runtime

Fred Bricon (JIRA) jira-events at lists.jboss.org
Fri Feb 24 05:16:37 EST 2012


    [ https://issues.jboss.org/browse/JBIDE-10401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670732#comment-12670732 ] 

Fred Bricon commented on JBIDE-10401:
-------------------------------------

Nick, there's a much much more elegant way to get that dicovery url filtered :

* add a discovery.properties file in the source directory, containing : discovery.url=${jboss.discovery.directory.url}
* change the pom.xml so that maven-resources-plugin filters that file :
{code:xml} 
<build>
  <resources>
    <resource>
      <directory>src</directory>
      <includes>
        <include>**/discovery.properties</include>
      </includes>
      <filtering>true</filtering>
    </resource>
  </resources>
  <plugins>
    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>2.5</version>
      <executions>
        <execution>
          <id>resource-filtering</id>
          <!-- Need to execute resource filtering AFTER tycho-compiler-plugin is executed -->
          <phase>process-classes</phase>
          <goals>
            <goal>resources</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
{code}

* read the properties value in the code (simplified) : String url =  ResourceBundle.getBundle("discovery").get("discovery.url");

This has the advantage to work with m2e within eclipse and most importantly, no need to duplicate and maintain 2 versions of the DefaultJBossCentralConfigurator (I know, as I've been hit by that, it's not documented in the original DefaultJBossCentralConfigurator).
                
> externalize URL for Central directory.xml file so it can be passed in via commandline when building or at runtime 
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-10401
>                 URL: https://issues.jboss.org/browse/JBIDE-10401
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Build/Releng, central, updatesite
>    Affects Versions: 3.3.0.M5
>            Reporter: Nick Boldt
>            Assignee: Nick Boldt
>            Priority: Critical
>             Fix For: 3.3.0.Beta1
>
>
> 1. Need to replace hardcoded variable
> {code}
>         private static final String JBOSS_DISCOVERY_DIRECTORY_3_3_0_XML = "http://download.jboss.org/jbosstools/updates/nightly/core/trunk/jbosstools-directory.xml"; // published URL
> {code}
> with value in plugin.properties. This will allow the plugin to be "fixed" when releasing it to point at a different URL.
> 2. Need to allow passing in the URL as a commandline variable at build-time so that we can have the same code overridden when built in stable branch for a milestone vs. in trunk.
> This could be done via Maven calling Ant in the pom.xml to do a simple XSLT on the build.properties file. (If you can't figure out another way, assign this part to me and I'll do this -- already have 80% of the code for such a transform in place.) This would allow overrides to be set in the parent/pom.xml or via commandline -D flags.
> 3. We could also set 4 variables in the plugin.properties file (for the 4 possible URLs) and have the -D flag be a simple switch between GA, milestone, nightly stable, and nightly trunk, without having to actually state the URL via the commandline.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list