The LSPS Application build is a standard maven build and as such you can manage all its dependencies.
Once you have adapted the build, you can test it on SDK Embedded Server. For deployment to other servers, build the application EAR.
To simplify the deployment during development of the LSPS Application, the SDK comes with SDK Embedded Server and its launcher: the launcher is created when you generate the LSPS Application along with the Maven build configuration for the application build. The launcher runs SDK Embedded Server with an exploded deployment of your application on its classpath: The configuration runs the main()
method in the <APP_PACKAGE>.embedded.LSPSLauncher
class.
Important: SDK Embedded Server is a different server from PDS Embedded Server.
You can run the server with the application in normal or debug mode:
Hence to build your application and run it on SDK Embedded Server, do the following:
<YOUR_APP>-embedded
project and select Run As > <YOUR_APP> Maven Build. Note: Next time build the application from the Run menu or from the drop-down of the Run icon on the toolbar.
<YOUR_APP>-embedded
project and select Run As > <YOUR_APP> Embedded Server Launcher. Note: Next time run the application server from the Run menu or from the drop-down of the Run icon on the toolbar.
To build the application EAR so you can deploy it on a supported application server, run mvn clean install
in the directory with the root pom.xml. Consider running the build with the provided tests with mvn clean install -Dlsps.tester
. The tester package includes various checks, including a check of the ear content against the dependencies in the jboss-deployment-structure.xml.
Important: When preparing LSPS Application EAR for production environment, disable the form preview feature from the application: Create a custom application navigator class that extends DefaultAppNavigator and override its addAllViews() method:
public class AppAppNavigator extends DefaultAppNavigator { public AppAppNavigator(UI ui, ViewDisplay display) { super(ui, display); } @Override protected void addAllViews() { addView(todoListViewId(), todoListViewClass()); addView(documentsViewId(), documentsViewClass()); addView(runModelViewId(), runModelViewClass()); addView(appSettingsViewId(), appSettingsViewClass()); addView(todoViewId(), todoViewClass()); addView(documentViewId(), documentViewClass()); //remove this: //addView(formPreviewId(), formPreviewViewClass()); } }
Make your LspsUI class (typically AppLspsUI), use this navigator: override the createNavigator method:
@Override protected void createNavigator(ViewDisplay display) { Navigator navigator = new AppAppNavigator(getUI(), display); navigator.addViewChangeListener(new PageTitleFromAppView()); }
The output EAR file is located in the target directory. To deploy follow the deployment instructions for your server.
To export a module into a deployable zip file as part of your Maven build use ModelExporter: ModelExporter exports the module with all imported modules and their dependencies including the Standard Library Modules.
To integrate the export in your Maven build include the plug-in in your pom.xml
:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.whitestein.lsps.export.ModelExporter</mainClass>
<arguments>
<argument>d:\CustomerModule</argument>
<argument>processes\Main</argument>
<argument>d:\CustomerProject\target\stdlib</argument>
<argument>d:\result.zip</argument>
</arguments>
</configuration>
</plugin>
Your can then use the resulting zip file as input for the uploadModel in your pom.xml
:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>uploadModel</id>
<goals>
<goal>java</goal>
</goals>
<phase>deploy</phase>
<configuration>
<mainClass>com.whitestein.lsps.mconsolecl.Main</mainClass>
<arguments>
<argument>modelUpload</argument>
<argument>-h</argument>
<argument>${modelUpload.host}</argument>
<argument>-u</argument>
<argument>${modelUpload.user}</argument>
<argument>-p</argument>
<argument>${modelUpload.password}</argument>
<!-- The output file of the ModelExporter run:-->
<argument>-m</argument>
<argument>d:\result.zip</argument>
<argument>--dbUpdateStrategy</argument>
<argument>${modelUpload.dbUpdateStrategy}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
If you plan to use libraries that are not imported by default, add them to the application pom.xml
as dependencies, so they are included by maven automatically, and compile the application:
<dependencyManagement>
of the main pom.xml.mvn clean eclipse:clean eclipse:eclipse install lsps:updateClasspath -DskipTests
.To remove a webapp you do not need, such as Monitoring, from dependencies, do the following:
LSPSLauncher
class in the embedded project.