Class ImportMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.isomorphic.maven.mojo.AbstractBaseMojo
com.isomorphic.maven.mojo.reify.ImportMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ValidateMojo

@Mojo(name="reify-import",
      requiresProject=false)
public class ImportMojo
extends AbstractBaseMojo
Provides for single-step download and extraction of assets hosted on the Reify platform. While there is nothing to prevent a user from modifying the imported resources, changes should almost always be made using Reify and then re-imported. If necessary, use the API (e.g., RPCManager.createScreen, Canvas.getByLocalId) to modify imported screen definitions at runtime. Imported MockDataSources can simply be replaced using e.g., SQLDataSources having the same ID in another directory - there is no reason to modify the contents of the 'mock' subdirectory.

To encourage recommended usage, the reify-import goal takes steps to detect local changes and fail when any are found. Refer to the skipOverwriteProtection parameter for details. Further, a validation step (optional, see skipValidationOnImport) attempts to detect commonly found discrepancies between your MockDataSources and working DataSources.

The Reify for Developers documentation topic contains further discussion around best practices during the design / development cycle.

If you've built your project using one of the Maven archetypes for either SmartGWT or SmartClient, you should have a skeleton configuration in you POM already. if not, add something like the following:

 <pluginManagement>
     <plugins>
         <plugin>
             <groupId>com.isomorphic</groupId>
             <artifactId>isc-maven-plugin</artifactId>
             <version>1.4.5</version>
             <!-- the m2pluginextras dependency will be required when skipValidationOnImport = false -->
             <dependencies>
                 <dependency>
                     <groupId>com.isomorphic.extras</groupId>
                     <artifactId>isomorphic-m2pluginextras</artifactId>
                    <version>${smartgwt.version}</version>
                 </dependency>       
             </dependencies>
         </plugin>
     </plugins>
 </pluginManagement>                
 
 <build>
     <plugins>
       <plugin>
           <groupId>com.isomorphic</groupId>
           <artifactId>isc-maven-plugin</artifactId>
           <configuration>
             <smartclientRuntimeDir>${project.parent.build.directory}/gwt/launcherDir/myapplication/sc</smartclientRuntimeDir>
             <dataSourcesDir>WEB-INF/ds/classic-models</dataSourcesDir>
           </configuration>
       </plugin>
     </plugins>
 </build>
 
and check that the SmartClient runtime has been extracted to the configured location (via e.g., mvn war:exploded, mvn jetty:run).
  • Field Details

    • serverUrl

      @Parameter(property="serverUrl", defaultValue="https://create.reify.com") protected String serverUrl
      The full URL of the Reify site hosting your project/s. Useful when running your own Reify OnSite instance, at e.g., 'http://localhost:8080/create/'.
      Since:
      1.4.2
    • serverId

      @Parameter(property="serverId", defaultValue="smartclient-developer") protected String serverId
      The id of a server configuration containing authentication credentials for the Reify site specified by serverUrl, used to download exported projects.
      Since:
      1.4.0
    • workdir

      @Parameter(property="workdir", defaultValue="${project.build.directory}/reify") protected File workdir
      The directory to which the archive is downloaded and unpacked. Note that this is not the final destination of exported assets. For that, see webappDir.
      Since:
      1.4.0
    • webappDir

      @Parameter(property="webappDir", defaultValue="${project.basedir}/src/main/webapp") protected File webappDir
      The directory containing web application sources.
      Since:
      1.4.0
    • smartclientRuntimeDir

      @Parameter(property="smartclientRuntimeDir", defaultValue="${project.build.directory}/${project.build.finalName}/isomorphic") protected File smartclientRuntimeDir
      The directory containing the Isomorphic runtime. The default value is appropriate for the path created by a typical mvn war:exploded invocation. Alternatively, set this to the path created by mvn jetty:run, or any other path where an appropriate SmartClient runtime may be found. Note that SmartGWT users may need to change the value to something like:

      ${project.build.directory}/${project.build.finalName}/${gwtModuleName}/sc

      Since:
      1.4.0
    • includeJs

      @Parameter(property="includeJs", defaultValue="false") protected boolean includeJs
      If true, the import process will *add* JavaScript versions of screens and MockDataSources, translated to JavaScript in the same way that the Isomorphic JSP tag library for screen or DS loading would do it. These resources have .ui.js and .ds.js extensions respectively.
      Since:
      1.4.5
    • includeTestJsp

      @Parameter(property="includeTestJsp", defaultValue="false") protected boolean includeTestJsp
      If true, the import process will create a JSP launcher that loads the given project/s. The file's name and location can be configured via testJspPathname.
      Since:
      1.4.0
    • testJspPathname

      @Parameter(property="testJspPathname", defaultValue="${projectName}.run.jsp") protected String testJspPathname
      The name (and optional path, relative to webappDir) of the JSP launcher to be created when includeTestJsp is true.
      Since:
      1.4.0
    • includeTestHtml

      @Parameter(property="includeTestHtml", defaultValue="false") protected boolean includeTestHtml
      If true, the import process will create an HTML launcher that loads the given project/s. The file's name and location can be configured via testHtmlPathname.
      Since:
      1.4.0
    • testHtmlPathname

      @Parameter(property="testHtmlPathname", defaultValue="${projectName}.run.html") protected String testHtmlPathname
      The name (and optional path, relative to webappDir) of the HTML launcher to be created when includeTestHtml is true.
      Since:
      1.4.0
    • dataSourcesDir

      @Parameter(property="dataSourcesDir", defaultValue="WEB-INF/ds") protected String dataSourcesDir
      The directory, relative to webappDir), in which your project's working datasources (i.e., other than mocks) reside.

      Note that this will need to conform to the webapp's server.properties project.datasources configuration.

      Since:
      1.4.0
    • mockDataSourcesDir

      @Parameter(property="mockDataSourcesDir", defaultValue="WEB-INF/ds/mock") protected String mockDataSourcesDir
      The directory, relative to webappDir), in which exported MockDataSources should ultimately reside.

      Note that this will need to conform to the webapp's server.properties project.datasources configuration.

      Since:
      1.4.0
    • skipValidationOnImport

      @Parameter(property="skipValidationOnImport", defaultValue="false") protected boolean skipValidationOnImport
      When true, DataSource validation will be skipped following import. The ValidateMojo can still be executed independently at any time.
      Since:
      1.4.0
    • validationFailureThreshold

      @Parameter(property="validationFailureThreshold", defaultValue="ERROR") protected com.isomorphic.util.ErrorMessage.Severity validationFailureThreshold
      One of INFO, ERROR, WARN that will determine the level of severity tolerated in any validation error. Any error at or above this threshold will result in "BUILD FAILURE".
      Since:
      1.4.0
    • uiDir

      @Parameter(property="uiDir", defaultValue="WEB-INF/ui") protected String uiDir
      The directory in which exported screens should ultimately reside, relative to webappDir. Note that this will need to conform to the webapp's server.properties project.ui configuration.
      Since:
      1.4.0
    • projectFileDir

      @Parameter(property="projectFileDir", defaultValue="WEB-INF/ui") protected String projectFileDir
      The directory to which the exported project file should ultimately reside, relative to webappDir. Note that this will need to conform to the webapp's server.properties project.project configuration.
      Since:
      1.4.0
    • modifyWelcomeFiles

      @Parameter(property="modifyWelcomeFiles", defaultValue="false") protected boolean modifyWelcomeFiles
      If true, the project's welcome files will be modified to include a script block that loads the imported project. Note that the loaded project is not drawn - for that, refer to drawOnWelcomeFiles. Welcome files are determined by scanning the project's web.xml file for the standard welcome-files declaration. If none is found, the webroot is searched for files named index.jsp and index.html.

      Subsequent imports of other projects append the newly imported project name to the existing one/s.

      Since:
      1.4.0
    • drawOnWelcomeFiles

      @Parameter(property="drawOnWelcomeFiles", defaultValue="false") protected boolean drawOnWelcomeFiles
      Like modifyWelcomeFiles, except this variant will draw the project's first screen when all of its screens have been loaded.
      Since:
      1.4.0
    • projectName

      @Parameter(property="projectName", defaultValue="${project.artifactId}", required=true) protected String projectName
      The name of the project as it's known by the reify.com environment.
      Since:
      1.4.0
  • Constructor Details

  • Method Details