Ubik Batch Server Environment Setup
From UbikWiki
(Difference between revisions)
(→Deploying a BAR during development:) |
(→Option 1 (New way) => Creating a batch project with Maven2:) |
||
(21 intermediate revisions not shown.) | |||
Line 1: |
Line 1: | ||
[[Category:Ubik Batch Server]] | [[Category:Ubik Batch Server]] | ||
- | = | + | |
- | == Creating a batch project: == | + | = Creating a batch project: = |
+ | Starting from 5.1.0.0, you have 2 options: | ||
+ | * Use Maven2 available since 5.1.0.0 (takes 10 seconds) | ||
+ | * Use classical ANT (takes a little more) | ||
+ | |||
+ | == Option 1 (New way) => Creating a batch project with Maven2: == | ||
+ | <source lang="text"> | ||
+ | mvn archetype:create | ||
+ | -DgroupId=<Your group ID> | ||
+ | -DartifactId=<You artifact ID> | ||
+ | -DarchetypeGroupId=com.ubikingenierie.console | ||
+ | -DarchetypeArtifactId=UbikBarArtifact | ||
+ | -DarchetypeVersion=6.0.0 | ||
+ | |||
+ | </source> | ||
+ | |||
+ | == Option 2 (old way) => Creating a batch project with ANT: == | ||
* Checkout from CVS/SVN the projects: | * Checkout from CVS/SVN the projects: | ||
* m2repository (MAVEN2 Repository) | * m2repository (MAVEN2 Repository) | ||
* Declare in Eclipse a new classpath variable (M2_REPO) that references this folder, Window > Preferences > Java > Build Path > Classpath Variables: | * Declare in Eclipse a new classpath variable (M2_REPO) that references this folder, Window > Preferences > Java > Build Path > Classpath Variables: | ||
- | |||
<center>[[Image:ECLIPSE_M2REPO.png]]</center> | <center>[[Image:ECLIPSE_M2REPO.png]]</center> | ||
- | + | * Create a new Java Project using Eclipse classical wizard | |
- | + | ||
- | * Create a new Project | + | |
* Add a folder called build and copy to this folder: | * Add a folder called build and copy to this folder: | ||
** M2_REPO\com\ubikingenierie\ubik-batch-server-builder\scripts\build-bar.xml | ** M2_REPO\com\ubikingenierie\ubik-batch-server-builder\scripts\build-bar.xml | ||
** M2_REPO\com\ubikingenierie\ubik-batch-server-builder\scripts\build-batch.properties | ** M2_REPO\com\ubikingenierie\ubik-batch-server-builder\scripts\build-batch.properties | ||
* Edit build-batch.properties: | * Edit build-batch.properties: | ||
- | |||
- | |||
{| class="prettytable" | {| class="prettytable" | ||
| Property name | | Property name | ||
| Description | | Description | ||
- | |||
|- | |- | ||
| project.name | | project.name | ||
| Name of the project without spaces (will be the ID of the BAR) | | Name of the project without spaces (will be the ID of the BAR) | ||
- | |||
|- | |- | ||
| build.target | | build.target | ||
| JDK Target (1.4 or 1.5) | | JDK Target (1.4 or 1.5) | ||
- | |||
|- | |- | ||
| console.version | | console.version | ||
| 5.0.1.1 | | 5.0.1.1 | ||
- | |||
|- | |- | ||
| M2_REPO | | M2_REPO | ||
| Full path to MAVEN2 Repository (use / instead of \) | | Full path to MAVEN2 Repository (use / instead of \) | ||
- | |||
|} | |} | ||
* Run ANT Target “create-project” | * Run ANT Target “create-project” | ||
* Refresh root of project | * Refresh root of project | ||
- | + | = Running a Local Batch server: = | |
To test your batches you will need to start a local batch server, to do this: | To test your batches you will need to start a local batch server, to do this: | ||
Line 53: |
Line 59: | ||
# Use it to connect to Batch Server with MC4J | # Use it to connect to Batch Server with MC4J | ||
- | + | = Deploying a BAR during development: = | |
* Ensure you use ECLIPSE 3.1 or above | * Ensure you use ECLIPSE 3.1 or above | ||
* Right click on project > Properties > UbikBatcherPlugin Classpath | * Right click on project > Properties > UbikBatcherPlugin Classpath | ||
Line 62: |
Line 68: | ||
* Start Batch Server | * Start Batch Server | ||
- | = | + | = Creating a BAR for deployment on Production environment: = |
- | + | Starting from 5.1.0.0, you have 2 options: | |
+ | * Use Maven2 (new preferred way available since 5.1.0.0) | ||
+ | * Use ANT (old way) | ||
- | [[Image:ECLIPSE_CLASSPATH.png]]* Run ANT Target “generate-bar” | + | == Option 1 (New way) => Creating a BAR with Maven2: == |
+ | If you created you Project with provided Maven artifact then just do the following: | ||
+ | <source lang="text"> | ||
+ | mvn clean install | ||
+ | </source> | ||
+ | |||
+ | If you didn't create it with provided Maven artifact do the following, edit "pom.xml" file and : | ||
+ | # set Packaging to bar: <source lang="xml" ><packaging>bar</packaging></source> | ||
+ | # add to build part: | ||
+ | <source lang="xml" ><build> | ||
+ | ... | ||
+ | <plugins> | ||
+ | <plugin> | ||
+ | <groupId>com.ubikingenierie.console</groupId> | ||
+ | <artifactId>maven-ubikbar-plugin</artifactId> | ||
+ | <version>5.1.0.0</version> | ||
+ | <extensions>true</extensions> | ||
+ | <configuration> | ||
+ | <!-- barConfigFolder references the base folder where barDescriptor and logConfigFile are located --> | ||
+ | <barConfigFolder>src/main/resources</barConfigFolder> | ||
+ | <barDescriptor>bar.xml</barDescriptor> | ||
+ | <logConfigFile>log.xml</logConfigFile> | ||
+ | <!-- Only if JAR com.foo:fwk is embedded in server --> | ||
+ | <excludedDeps> | ||
+ | <param>com.foo:fwk</param> | ||
+ | </excludedDeps> | ||
+ | </configuration> | ||
+ | </plugin> | ||
+ | ... | ||
+ | </plugins></source> | ||
+ | # add a dependency to UBIK-INGENIERIE Batch Server libraries: | ||
+ | <source lang="xml"> | ||
+ | <dependency> | ||
+ | <groupId>com.ubikingenierie.console</groupId> | ||
+ | <artifactId>console</artifactId> | ||
+ | <version>5.1.0.0</version> | ||
+ | </dependency></source> | ||
+ | |||
+ | == Option 2 (Old way) => Creating a BAR with ANT: == | ||
+ | * Ensure you only reference libraries through M2_REPO Variable (Libraries are added through “Add Variable”): | ||
+ | [[Image:ECLIPSE_CLASSPATH.png]] | ||
+ | * Run ANT Target “generate-bar” |
Current revision
Contents |
Creating a batch project:
Starting from 5.1.0.0, you have 2 options:
- Use Maven2 available since 5.1.0.0 (takes 10 seconds)
- Use classical ANT (takes a little more)
Option 1 (New way) => Creating a batch project with Maven2:
mvn archetype:create -DgroupId=<Your group ID> -DartifactId=<You artifact ID> -DarchetypeGroupId=com.ubikingenierie.console -DarchetypeArtifactId=UbikBarArtifact -DarchetypeVersion=6.0.0
Option 2 (old way) => Creating a batch project with ANT:
- Checkout from CVS/SVN the projects:
- m2repository (MAVEN2 Repository)
- Declare in Eclipse a new classpath variable (M2_REPO) that references this folder, Window > Preferences > Java > Build Path > Classpath Variables:
- Create a new Java Project using Eclipse classical wizard
- Add a folder called build and copy to this folder:
- M2_REPO\com\ubikingenierie\ubik-batch-server-builder\scripts\build-bar.xml
- M2_REPO\com\ubikingenierie\ubik-batch-server-builder\scripts\build-batch.properties
- Edit build-batch.properties:
Property name | Description |
project.name | Name of the project without spaces (will be the ID of the BAR) |
build.target | JDK Target (1.4 or 1.5) |
console.version | 5.0.1.1 |
M2_REPO | Full path to MAVEN2 Repository (use / instead of \) |
- Run ANT Target “create-project”
- Refresh root of project
Running a Local Batch server:
To test your batches you will need to start a local batch server, to do this:
- Checkout from CVS the project “batchserver-runner”
- Open config/config.properties and modify:
- CONSOLE_ID to ensure it is unique (use for example BATCH_<YOUR ACRONYM>)
- INSTALL_DIR to point to the folder of batchserver-runner (use “/” and not “\”)
- Open config/datasource.xml and modify connection to DB configuration
- Choose Debug Perspective and click on BatchServer-Runner:
- Batch server is successfully started when the following message appears:
Console started at 09/10/2008 09:37:38
- JMX URL is written in file config\jmx-service-url.txt
- Use it to connect to Batch Server with MC4J
Deploying a BAR during development:
- Ensure you use ECLIPSE 3.1 or above
- Right click on project > Properties > UbikBatcherPlugin Classpath
- Check activate
- Click on Check ALL
- Run ANT Target “generate-bar-dev”
- Copy dist\<Name of project>.bar to <LOCAL BATCH SERVER>/batches-cold-deploy
- Start Batch Server
Creating a BAR for deployment on Production environment:
Starting from 5.1.0.0, you have 2 options:
- Use Maven2 (new preferred way available since 5.1.0.0)
- Use ANT (old way)
Option 1 (New way) => Creating a BAR with Maven2:
If you created you Project with provided Maven artifact then just do the following:
mvn clean install
If you didn't create it with provided Maven artifact do the following, edit "pom.xml" file and :
- set Packaging to bar:
<packaging>bar</packaging>
- add to build part:
<build> ... <plugins> <plugin> <groupId>com.ubikingenierie.console</groupId> <artifactId>maven-ubikbar-plugin</artifactId> <version>5.1.0.0</version> <extensions>true</extensions> <configuration> <!-- barConfigFolder references the base folder where barDescriptor and logConfigFile are located --> <barConfigFolder>src/main/resources</barConfigFolder> <barDescriptor>bar.xml</barDescriptor> <logConfigFile>log.xml</logConfigFile> <!-- Only if JAR com.foo:fwk is embedded in server --> <excludedDeps> <param>com.foo:fwk</param> </excludedDeps> </configuration> </plugin> ... </plugins>
- add a dependency to UBIK-INGENIERIE Batch Server libraries:
<dependency> <groupId>com.ubikingenierie.console</groupId> <artifactId>console</artifactId> <version>5.1.0.0</version> </dependency>
Option 2 (Old way) => Creating a BAR with ANT:
- Ensure you only reference libraries through M2_REPO Variable (Libraries are added through “Add Variable”):
- Run ANT Target “generate-bar”