Skip to content

Commit

Permalink
maven integration
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Oct 17, 2024
1 parent 45ff12d commit bad3acd
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ settings.xml
WEB-INF

# Engines + Database + CBFS + Secrets
.tmp/**
.env
.engine/**
.cbfs/**
build/.db/**
grapher/**

# logs + tests
logs/**
Expand All @@ -22,3 +24,4 @@ yarn-error.log
/coldbox/**
/testbox/**
/modules/**
/lib/java/**
Empty file removed interceptors/.gitkeep
Empty file.
52 changes: 52 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!--
Your Project Info : Only use if you are building Java Source
If you are just using this for Java dependencies, then ignore this section
-->
<groupId>com.example</groupId>
<artifactId>coldbox-app</artifactId>
<version>1.0.0</version>

<dependencies>
<!--
Add all the Java dependencies you need here.
You can search for more here: https://central.sonatype.com/
All Dependencies for the BoxLang application will be stored under the lib/java folder
Just Run: mvn install to install all dependencies
-->

<!-- Here is an example -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.12.0</version>
</dependency>
</dependencies>

<build>
<directory>${project.basedir}/.tmp</directory>
<plugins>
<!-- This puts the dependencies in your project's lib/java folder -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/lib/java</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ box server start

Code to your liking and enjoy!

## Java Dependencies

If your project relies on Java third-party dependencies, you can use the included Maven `pom.xml` file in the root. You can add your dependencies there and then run the `mvn install` command to download them into the `lib/java` folder. The ColdBox application will automatically class load all the jars in that folder for you! You can also use the `mvn clean` command to remove all the jars.

You can find Java dependencies here: <https://central.sonatype.com/>. Just grab the Maven coordinates and add them to your `pom.xml` file.

## Dockerfile

We have included a [`build/Dockerfile`](build/Dockerfile) so you can build docker containers from your source code. We have also added two scripts in your `box.json` so you can build the docker image and run the docker image using our [CommandBox Docker](https://hub.docker.com/r/ortussolutions/commandbox) containers.
Expand Down

0 comments on commit bad3acd

Please sign in to comment.