maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Zeleznik" <>
Subject JBuilder Plugin
Date Tue, 25 Mar 2003 22:50:36 GMT

We are a heavy user of both JBuilder and IDEA and have found that the
current JBuilder plugin is much less functional than the IDEA plugin for
generating project files. I have started working on improving the
jbuilder:generate-project goal, but would like to know if anyone else is
working in this area. I will be happy to send my changes to the list if
anyone is interested. I just do not want to conflict if there is active
development on this plugin.

As to the jbuilder:generate-library goal, this one seems completely broken
and actually generates circular references. I am not sure what the original
developer had in mind. My idea is to generate library files directly into
the user's jbuilder home directory where they can then be referenced by the
generated JBuilder projects and other libraries. If a person does
generate-project and some of the projects dependencies do not have library
files created yet, a default library definition will be created that simply
references the jar in the local repo. The user can then override this
default library definition by going to the dependency project and doing
generate-library. This will generate a library definition that includes the
source code. I am also planning to generate versioned library definitions,
rather than just using the artifactId like the current plugin does.

I have attached my first rough draft of my generate-project improvements.
Note, that handling of the project dependencies and libraries is not
implemented yet. It is next on my todo list.

    description="Generate JBuilder [id_project].jpx file">

    <!-- This forces the javadoc plugin to load and read its properties -->
    <attainGoal name="maven-javadoc-plugin:register" />

    <echo>Creating ${basedir}/${pom.artifactId}.jpx ...</echo>

    <!-- Initialize default values for project properties. If we find a
         JBuilder project, then its values will override some of these. -->
    <j:set var="authorLabel"      value="@author" />
    <j:set var="backupPath"       value="bak" />
    <j:set var="beansInstantiate" value="false" />
    <j:set var="company"          value="${}" />
    <j:set var="companyLabel"     value="Company: " />
    <j:set var="copyrightLabel"   value="Copyright: " />
    <j:set var="descriptionLabel" value="Description: " />
    <j:set var="docPath"
adoc.destdir')}" />
    <j:set var="includeTestPath"  value="1" />
    <j:set var="jdk"              value="java ${java.vm.version}" />
    <j:set var="titleLabel"       value="Title: " />
    <j:set var="versionLabel"     value="@version" />
    <j:set var="workingDir"       value="." />

    <!-- Format the year. -->
       <format property="currentYear" pattern="yyyy" />
        <j:when test="${pom.inceptionYear.equals(currentYear)}">
          <format property="year" pattern="yyyy"/>
          <format property="year" pattern="${pom.inceptionYear}-yyyy"/>

    <!-- Find and read the JBuilder default project properties. -->
    <j:set var="jbuilderDirs"
value=".jbuilder8,.jbuilder7,.jbuilder6,.jbuilder5,.jbuilder4,.jbuilder" />
    <u:tokenize var="jbuilderDirList" delim=",">${jbuilderDirs}</u:tokenize>
    <j:forEach var="dir" items="${jbuilderDirList}">
      <j:set var="jbUserHome" value="${user.home}/${dir}" />
      <j:set var="defaultProject" value="${jbUserHome}/Default.jpr" />
      <u:available file="${defaultProject}">
        <j:set var="jbDefaultProject" value="${defaultProject}" />
    <j:if test="${jbDefaultProject == null}" >

      <echo>| WARNING!</echo>
      <echo>| A JBuilder installation could not be found. The project
      <echo>| being created will contain default values.</echo>

    <j:if test="${jbDefaultProject != null}" >
      <echo>Reading default project ${jbDefaultProject}</echo>
      <u:properties file="${jbDefaultProject}" var="defaultProps" />
      <j:set var="authorLabel"
value="${defaultProps.getProperty('sys[0].AuthorLabel')}" />
      <j:set var="backupPath"
value="${defaultProps.getProperty('sys[0].BackupPath')}" />
      <j:set var="backupPath"       value="${backupPath.replaceAll('%%\|',
':')}" />
      <j:set var="beansInstantiate"
value="${defaultProps.getProperty('sys[0].BeansInstantiate')}" />
      <j:set var="companyLabel"
value="${defaultProps.getProperty('sys[0].CompanyLabel')}" />
      <j:set var="copyrightLabel"
value="${defaultProps.getProperty('sys[0].CopyrightLabel')}" />
      <j:set var="descriptionLabel"
value="${defaultProps.getProperty('sys[0].DescriptionLabel')}" />
      <j:set var="titleLabel"
value="${defaultProps.getProperty('sys[0].TitleLabel')}" />
      <j:set var="versionLabel"
value="${defaultProps.getProperty('sys[0].VersionLabel')}" />
      <available property="jdkDefPresent"
file="${jbUserHome}/${jdk}.library" />
      <j:if test="${!jdkDefPresent}">

        <echo>| WARNING!</echo>
        <echo>| This project is being configured to use ${jdk}. This</echo>
        <echo>| JDK has not been configured yet in your JBuilder
        <echo>| Go to Tools|Configure JDKs.</echo>


    <!-- Format the copyright notice. -->
    <j:set var="copyright" value="Copyright (c) ${year} ${company} - All
Rights Reserved." />

	  <j:file name="${basedir}/${pom.artifactId}.jpx" prettyPrint="true"
  	    <x:comment>JBuilder XML Project</x:comment>
        <property category="sys" name="Author"
value="${maven.username}" />
    	  <property category="sys" name="AuthorLabel"
value="${authorLabel}" />
        <property category="sys" name="BackupPath"
value="${backupPath}" />
        <property category="sys" name="BeansInstantiate"
value="${beansInstantiate}" />
        <property category="sys" name="Company"          value="${company}"
    	  <property category="sys" name="CompanyLabel"
value="${companyLabel}" />
        <property category="sys" name="Copyright"
value="${copyright}" />
        <property category="sys" name="CopyrightLabel"
value="${copyrightLabel}" />
        <property category="sys" name="DefaultPath"
value="${}" />
        <property category="sys" name="Description"
value="${pom.shortDescription}" />
        <property category="sys" name="DescriptionLabel"
value="${descriptionLabel}" />
        <property category="sys" name="DocPath"          value="${docPath}"
        <property category="sys" name="IncludeTestPath"
value="${includeTestPath}" />
        <property category="sys" name="JDK"              value="${jdk}" />
        <property category="sys" name="Libraries"
value="${libraries}" />
        <property category="sys" name="OutPath"
value="${}" />
    	  <property category="sys" name="SourcePath"
value="${};${}" />
    	  <property category="sys" name="TestPath"
value="${}" />
        <property category="sys" name="Title"            value="${}"
        <property category="sys" name="TitleLabel"
value="${titleLabel}" />
    	  <property category="sys" name="Version"
value="${pom.currentVersion}" />
    	  <property category="sys" name="VersionLabel"
value="${versionLabel}" />
    	  <property category="sys" name="WorkingDirectory"
value="${workingDir}" />

I would be interested in any feedback from others using both Maven and
JBuilder on the same projects.

David Zeleznik
ILOG - Changing the rules of business

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message