Skip to content

Commit

Permalink
Add Maven profile for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
smailliwcs committed Sep 20, 2024
1 parent e602bd1 commit d596308
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
13 changes: 5 additions & 8 deletions Java/measureeval/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ Perform the following from the `/Java` directory, which builds the measureeval J
module:

```bash
mvn clean install -pl measureeval -am
mvn -P cli -pl measureeval -am clean package
```

## Running the CLI

To bypass the JAR manifest's main() class that runs it as a service, run the JAR with the following parameters:
`-Dloader.main=com.lantanagroup.link.measureeval.FileSystemInvocation org.springframework.boot.loader.launch.PropertiesLauncher`
We use the `cli` Maven profile to ensure that `FileSystemInvocation` is used as the main class.

### Parameters

Expand All @@ -28,11 +25,11 @@ To bypass the JAR manifest's main() class that runs it as a service, run the JAR
Format:

```bash
java -cp measureeval-<version>.jar -Dloader.main=com.lantanagroup.link.measureeval.FileSystemInvocation org.springframework.boot.loader.launch.PropertiesLauncher "<measure-bundle-path>" "<patient-bundle-path>" "<start>" "<end>"
java -jar measureeval-<version>.jar "<measure-bundle-path>" "<patient-bundle-path>" "<start>" "<end>"
```

Example:

```bash
java -cp measureeval-<version>.jar -Dloader.main=com.lantanagroup.link.measureeval.FileSystemInvocation org.springframework.boot.loader.launch.PropertiesLauncher "C:/path/to/measure-bundle.json" "C:/path/to/patient-bundle.json" "2021-01-01" "2021-12-31"
```
java -jar measureeval-<version>.jar "C:/path/to/measure-bundle.json" "C:/path/to/patient-bundle.json" "2021-01-01" "2021-12-31"
```
21 changes: 20 additions & 1 deletion Java/measureeval/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
</execution>
</executions>
<configuration>
<mainClass>com.lantanagroup.link.measureeval.MeasureEvalApplication</mainClass>
<mainClass>${mainClass}</mainClass>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
Expand All @@ -157,4 +157,23 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>api</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<mainClass>com.lantanagroup.link.measureeval.MeasureEvalApplication</mainClass>
</properties>
</profile>

<profile>
<id>cli</id>
<properties>
<mainClass>com.lantanagroup.link.measureeval.FileSystemInvocation</mainClass>
</properties>
</profile>
</profiles>
</project>

0 comments on commit d596308

Please sign in to comment.