|
1 | 1 | --- |
2 | | -title: Lucee with Maven |
| 2 | +title: Embedding Lucee in Java Applications |
3 | 3 | id: lucee-with-maven |
4 | 4 | categories: |
5 | 5 | - java |
| 6 | +description: How to embed Lucee as a dependency in your Java projects using Maven |
6 | 7 | --- |
7 | 8 |
|
8 | | -<https://mvnrepository.com/artifact/org.lucee/lucee> |
| 9 | +Lucee is published to Maven Central, making it easy to embed the CFML engine directly into your Java applications. This is useful when you want to: |
9 | 10 |
|
10 | | -<https://search.maven.org/artifact/org.lucee/lucee> |
| 11 | +- Execute CFML templates from within a Java application |
| 12 | +- Build custom tooling that needs to parse or analyse CFML code |
| 13 | +- Create hybrid applications that leverage both Java and CFML |
| 14 | +- Develop and test Lucee extensions |
11 | 15 |
|
12 | | -You can add Lucee to your Maven pom.xml files via the following: |
| 16 | +## Maven Coordinates |
13 | 17 |
|
14 | | -And the dependency via: |
| 18 | +Lucee artifacts are available on Maven Central: |
15 | 19 |
|
16 | | -```lucee |
| 20 | +- <https://mvnrepository.com/artifact/org.lucee/lucee> |
| 21 | +- <https://search.maven.org/artifact/org.lucee/lucee> |
| 22 | + |
| 23 | +## Adding Lucee to Your Project |
| 24 | + |
| 25 | +Add the following dependency to your `pom.xml`: |
| 26 | + |
| 27 | +```xml |
17 | 28 | <dependency> |
18 | 29 | <groupId>org.lucee</groupId> |
19 | 30 | <artifactId>lucee</artifactId> |
20 | | - <version>5.3.8.206</version> |
| 31 | + <version>7.0.0.395</version> |
| 32 | +</dependency> |
| 33 | +``` |
| 34 | + |
| 35 | +This pulls in Lucee with all its dependencies, except database drivers which are marked as optional. |
| 36 | + |
| 37 | +### Minimal JAR |
| 38 | + |
| 39 | +If you only need the core Lucee classes without transitive dependencies, use the `lucee-jar` artifact instead: |
| 40 | + |
| 41 | +```xml |
| 42 | +<dependency> |
| 43 | + <groupId>org.lucee</groupId> |
| 44 | + <artifactId>lucee-jar</artifactId> |
| 45 | + <version>7.0.0.395</version> |
21 | 46 | </dependency> |
22 | 47 | ``` |
23 | 48 |
|
24 | | -Or the single Lucee jar artifactId is "lucee-jar". (The above has all the dependencies, with the exception of database drivers which are marked as "optional", thus not included by default.) |
| 49 | +## Related |
| 50 | + |
| 51 | +If you're a CFML developer looking to load Java libraries into your Lucee application at runtime, see the [Maven recipe](../../recipes/maven.md) which covers the `this.javasettings` approach introduced in Lucee 6.2. |
0 commit comments