Child pages
  • Command line utilities for Exporting of Solutions and Unit Testing

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Servoy allows you to export workspace solutions into .servoy files or .war files as well as to run jsunit tests on these using command line.
If you are looking for an example on how these tools were used for unit testing see Servoy Software Factory Example using Jenkins.
 

NGClient, WebClient and Smart Client ".war" export

 

This exporter will export NGClient, WebClient and SmartClient solutions as .war files. There is also an exporter specific for mobile typed solutions that also generates a .war file but that one is separate is is detailed later.

 

To see the help message do the following:

 
  1. Change the current directory to <servoy_install>\developer\exporter
  2. execute (.bat/.sh depends on your OS): war_export.bat  -help
 

This will output the help for the Command Line War Export Application. To do a war export a command similar to the following should be executed:

 
Code Block
languagepowershell
war_export.bat -s <solution_name> -o <out_dir> -data <workspace_location> -defaultAdminUser <admin username> -defaultAdminPassword <admin password> [optional_args]
 

Output of "war_export.bat  -help" is: 

 
Expand
titlesee .war exporter arguments


Code Block
languagepowershell
WAR exporter. Exports workspace solutions into .war files.
USAGE:

   -help or -? or /? or no arguments ... shows current help message.

                  OR

   -s <solution_name> -o <out_dir> -data <workspace_location>
   Note: <solution_name> can  also  contain multiple solution names  separated  by comma. In
         that case, one .war file will be generated for each solution in that  list. Some of
         the options below  (for example -warFileName)  do not make sense when multiple .war
         files are to be created. There is a note on each such option.

   -defaultAdminUser <user name for admin page when no admin user exists>
   -defaultAdminPassword <password for defaultAdminUser> [optional_args]

        Optional arguments:

        -verbose ... prints more info to console
        -p <properties_file> ... path and name of properties file used to start exporter.
             Default: the 'servoy.properties' file  from 'application_server'  will be used.
        -as <app_server_dir> ... specifies where to find the 'application_server' directory.
             Default: '../../application_server'.
        -pl alternate project locations; solution, resources and  other needed projects will
             be searched for in subfolders (deep) of the given 'workspace_location' as well.
                                                                         For example: if the
             workspace needs to contain projects from different git repositories,  those can
             be checked out in '<workspace_loc>', '<workspace_loc>/a', '<workspace_loc>/b/c'
             and so on.
        -ie ignore build errors.  CAUTION! the use of this flag is discouraged; it can cause
             invalid solutions to be exported.
		-sb skip build. No build markers will be generated. This can greatly decrease
			 export time. CAUTION! the use of this flag is discouraged;
             it can cause invalid solutions to be exported (added in 2019.12).
        -dbi ... export based on dbi files (even if database servers are available)
        -active <true/false> ... export  given solution  (and its modules) as part  of .war.
             That means the (current if more) solution  from -s  parameter and  its modules.
             If false,  it will create a war with no solution  included. If false,  you will
             have to import  solutions using the admin page. It does  not make sense  to use
             false if multiple solutions were given at -s.
             Default: true
        -pfw <properties_file> ... path & name of properties file to be included in the war.
             Default: the 'servoy.properties' file  from 'application_server'  will be used.
        -b <bean_names> ... the space separated list of (smart / web client) beans to export
             Default: all beans from application_server/beans are exported.
             You can use '-b <none>' to avoid exporting beans.
        -excludeBeans <bean_names> ... the  list of beans to excluded from  the export e.g.:
             -excludeBeans bean1.jar bean2.zip
             Default: none is excluded.
        -l <lafs_names> ... the space separated list of look-and-feels (smart cl.) to export
             Default: all lafs from application_server/lafs are exported.
             You can use '-l <none>' to avoid exporting lafs.
        -excludeLafs <lafs_names> ... the list of lafs to be excluded  from  the export e.g:
             -excludeLafs laf1.jar laf2.zip
             Default: none is excluded.
        -d <jdbc_drivers> ... the space separated list of  jdbc (database) drivers to export
             Default: all drivers from application_server/drivers are exported.
             You can use '-d <none>' to avoid exporting drivers.
        -excludeDrivers <jdbc_drivers> ... the  list of drivers  to exclude from  the export
             e.g.: -excludeDrivers driver1.jar driver2.zip
             Default: none is excluded.
        -pi <plugin_names> ... the list of plugins to export e.g -pi plugin1.jar plugin2.zip
             Default: all plugins from application_server/plugins are exported.
             You can use '-pi <none>' to avoid exporting plugins.
        -excludePlugins <plugin_names> ... the  list of plugins  to exclude from  the export
             e.g.: -excludePlugins plugin1.jar plugin2.zip
             Default: none is excluded.
        -nas ... space separated list of solutions that must be exported but are not in the
             current solution's modules (for example solutions for batch processors).
             If active is false  no solution will be exported  in war. It might be  wrong to
             use this flag if you also specify multiple solutions in -s.
             Default: only active solution and its modules are exported.
        -pluginLocations <ABSOLUTE paths to developer 'plugins' folder> ...  needed in  case
             you don't run the exporter from [servoy_install]/developer/exporter
             Default: '../plugins'.
        -crefs ... exports only the components used by the (current if -s has more) solution
             Default: all components are exported.
        -crefs <additional_component_names> ... can be 'all'  (without the ')  or a  list of
             components separated by spaces; exports the  components  used  by  the solution
             (current if -s has more) and the components in this additional components list.
             Default: all components are exported.
        -excludeComponentPkgs ... space separated list of excluded component packages
             Default: none is excluded.
        -srefs ... exports  only the services used by  the (current if -s has more) solution
             Default: all services are exported.
        -srefs <additional_service_names> ... can  be  'all' (no ')  or  a list  of services
             separated by spaces; exports the services used by the  (current if -s has more)
             solution  and the services in this additional services list.
             Default: all services are exported.
        -excludeServicePkgs ... space separated list of excluded service packages.
             Default: none is excluded.
        -md ... export metadata tables (tables marked as metadata); uses the metadata stored
             in workspace files for each metadata table.
        -checkmd ... check that metadata for metadata tables is the same for each table both
             in the according workspace file and in the actual table in the  database before
             exporting; this only makes sense if -md was specified
             Default: false
        -sd ... exports sample data. IMPORTANT all needed DB servers must already be started
        -sdcount <count> ... number of rows to  export per table. Only  makes sense when -sd
             is also present. Can be 'all' (without the ') in which  case  it will  still be
             limited but to a very high number: 49999999
             Default: 5000
        -i18n ... exports i18n data
        -users ... exports users
        -tables ... export  all table  information  about  tables from  referenced  servers.
             IMPORTANT: all needed DB servers must already be started
        -warFileName ... the name of the  war file; do *NOT* use this if  multiple solutions
             were given in -s argument (it does not make sense then as multiple wars will be
             generated).
             Default: the (current if -s has more) solution name
        -overwriteGroups ...  overwrites Groups
        -allowSQLKeywords ... allows SQLKeywords
        -stopOnDataModelChanges ... stops import if data model changes.
             This option is ignored if allowDataModelChanges is present.
        -allowDataModelChanges ... (optionally) a space separated list of server names  that
             allow data model changes.  If the list is missing,  then data model changes are
             allowed on all servers.
        -skipDatabaseViewsUpdate... skips database views update 
        -overrideSequenceTypes ... overrides Sequence Types
        -overrideDefaultValues ... overrides Default Values
        -insertNewI18NKeysOnly ... inserts NewI18NKeysOnly
        -importUserPolicy ... 0/1/2 where:
             don't = 0
             create users & update groups = 1 (default)
             overwrite completely = 2
        -addUsersToAdminGroup ... adds Users To Admin Group
        -updateSequences ... updates Sequences
        -upgradeRepository ... automatically upgrade repository if needed
        -createTomcatContextXML ... create   a   META-INF/context.xml   file;   please   see
             https://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Standard_Implement
             ation for more information.
        -antiResourceLocking ... add antiResourceLocking="true" to Context element; may only
             be used with createTomcatContextXML.
        -clearReferencesStatic ... add clearReferencesStatic="true" to  Context element; may
             only be used with createTomcatContextXML.
        -clearReferencesStopThreads ... add   clearReferencesStopThreads="true"   to Context
             element; may only be used with createTomcatContextXML.
        -clearReferencesStopTimerThreads ... add  clearReferencesStopTimerThreads="true"  to
             Context element; may only be used with createTomcatContextXML.
        -useAsRealAdminUser ... the  default admin user login  given via   -defaultAdminUser
             above will be available as a normal admin user in solutions as well.
        -minimize ... minimize JS and CSS files 
        -license.company_name OR license.<i>.company_name,
             The name of the company that has the license,  where <i> is used when there are
             multiple licenses:
             -license.1.company_name name1 -license.2.company_name name2
        -license.code OR license.<i>.code,
             The license code, where <i> is used when there are multiple licenses:
             -license.1.code XXXX-XXXX-XXXX -license.2.code  XXXX-XXXX-XXXX
        -license.licenses OR license.<i>.licenses,
             The number of licenses, where <i> is used when there are multiple licenses:
             -license.1.licenses SERVER -license.2.licenses 1000
        -userHomeDirectory <user_home_directory> ... this must be a writable directory where
             Servoy application  related files  will be stored;  if not set, then the system
             user home directory will be used.
        -doNotOverwriteDBServerProperties ... SKIP overwrite of old DBserver properties - if
             they were  stored separately  by  a previously deployed war  (due to changes to
             properties via admin page) - with ones from the war export's servoy.properties.
             If -overwriteAllProperties below is set then this flag has no effect.  Prior to
             Servoy 2019.09,  '-overwriteDBServerProperties'  was used instead but it is now
             removed in order to have the same default value as in UI export wizard.
        -overwriteAllProperties ... overwrite  all  (potentially  changed  via  admin  page)
             properties  of a previously deployed war  application  with the values from the
             servoy.properties of this war export.
        -log4jConfigurationFile ... a  path  to a log4j  configuration file  that  should be
             included nstead of the default one.
        -webXmlFileName ... a path to a web.xml  that should be included instead  of default
             one; it should be a web.xml file previously generated via a Servoy WAR export.

EXIT codes: 0 - normal, 1 - export stopped by user, 2 - export failed, 3 - invalid arguments
Export DONE.




...