How to run OpenElis from source code?

Hi, I had the same issue and tried your solution but that didn’t fix it. Do you have any other suggestions? The output I get when trying to run docker-compose -f build.docker-compose.yml up -d --build is:

[+] Building 3.4s (26/37)                                                                                                                                                                                                docker:desktop-linux
 => [oe.openelis.org internal] load build definition from Dockerfile                                                                                                                                                                     0.0s
 => => transferring dockerfile: 3.28kB                                                                                                                                                                                                   0.0s
 => [oe.openelis.org internal] load .dockerignore                                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                                                          0.0s
 => [oe.openelis.org internal] load metadata for docker.io/library/tomcat:8.5-jdk11                                                                                                                                                      1.1s
 => [oe.openelis.org internal] load metadata for docker.io/library/maven:3-jdk-11                                                                                                                                                        1.1s
 => [oe.openelis.org auth] library/maven:pull token for registry-1.docker.io                                                                                                                                                             0.0s
 => [oe.openelis.org auth] library/tomcat:pull token for registry-1.docker.io                                                                                                                                                            0.0s
 => [oe.openelis.org internal] load build context                                                                                                                                                                                        0.9s
 => => transferring context: 1.11MB                                                                                                                                                                                                      0.9s
 => [oe.openelis.org stage-1  1/13] FROM docker.io/library/tomcat:8.5-jdk11@sha256:5cac693de42353b7c53727aaf3505d0a72f0fc0585195404d69259ab4d4ee8c4                                                                                      0.0s
 => [oe.openelis.org build  1/17] FROM docker.io/library/maven:3-jdk-11@sha256:805f366910aea2a91ed263654d23df58bd239f218b2f9562ff51305be81fa215                                                                                          0.0s
 => CACHED [oe.openelis.org stage-1  2/13] ADD install/createDefaultPassword.sh ./                                                                                                                                                       0.0s
 => CACHED [oe.openelis.org stage-1  3/13] RUN rm -rf /usr/local/tomcat/webapps/*     /usr/local/tomcat/conf/Catalina/localhost/manager.xml                                                                                              0.0s
 => CACHED [oe.openelis.org stage-1  4/13] ADD install/tomcat-resources/ROOT.war /usr/local/tomcat/webapps/ROOT.war                                                                                                                      0.0s
 => CACHED [oe.openelis.org build  2/17] RUN apt-get -y update                                                                                                                                                                           0.0s
 => CACHED [oe.openelis.org build  3/17] RUN apt-get -y install git apache2-utils                                                                                                                                                        0.0s
 => CACHED [oe.openelis.org build  4/17] ADD .git /build/.git                                                                                                                                                                            0.0s
 => CACHED [oe.openelis.org build  5/17] ADD .gitmodules /build/.gitmodules                                                                                                                                                              0.0s
 => CACHED [oe.openelis.org build  6/17] ADD ./pom.xml /build/pom.xml                                                                                                                                                                    0.0s
 => CACHED [oe.openelis.org build  7/17] ADD ./tools /build/tools                                                                                                                                                                        0.0s
 => CACHED [oe.openelis.org build  8/17] ADD ./src /build/src                                                                                                                                                                            0.0s
 => CACHED [oe.openelis.org build  9/17] ADD ./install /build/install                                                                                                                                                                    0.0s
 => CACHED [oe.openelis.org build 10/17] ADD ./dev /build/dev                                                                                                                                                                            0.0s
 => CACHED [oe.openelis.org build 11/17] WORKDIR /build                                                                                                                                                                                  0.0s
 => CACHED [oe.openelis.org build 12/17] RUN git submodule update --init --recursive                                                                                                                                                     0.0s
 => CACHED [oe.openelis.org build 13/17] RUN ./install/createDefaultPassword.sh -c -p adminADMIN!                                                                                                                                        0.0s
 => CACHED [oe.openelis.org build 14/17] WORKDIR /build/dataexport                                                                                                                                                                       0.0s
 => ERROR [oe.openelis.org build 15/17] RUN mvn clean install -DskipTests                                                                                                                                                                1.3s
------
 > [oe.openelis.org build 15/17] RUN mvn clean install -DskipTests:
1.184 [INFO] Scanning for projects...
1.280 [INFO] ------------------------------------------------------------------------
1.280 [INFO] BUILD FAILURE
1.280 [INFO] ------------------------------------------------------------------------
1.286 [INFO] Total time:  0.133 s
1.298 [INFO] Finished at: 2023-11-03T00:55:09Z
1.298 [INFO] ------------------------------------------------------------------------
1.300 [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/build/dataexport). Please verify you invoked Maven from the correct directory. -> [Help 1]
1.300 [ERROR] 
1.300 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
1.300 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
1.300 [ERROR] 
1.300 [ERROR] For more information about the errors and possible solutions, please read the following articles:
1.300 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
------
failed to solve: process "/bin/sh -c mvn clean install -DskipTests" did not complete successfully: exit code: 1

I am running that command from my root directory which has a pom.xml in it. When I run run mvn clean install -DskipTests the output is:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.openelisglobal:openelisglobal:war:2.7.3.4
[WARNING] 'version' contains an expression but should be a constant. @ org.openelisglobal:openelisglobal:${major.version}.${minor.version}.${state.version}.${fix.version}, /OpenELIS-Global-2/pom.xml, line 8, column 11
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] -----------------< org.openelisglobal:openelisglobal >------------------
[INFO] Building openelisglobal 2.7.3.4
[INFO]   from pom.xml
[INFO] --------------------------------[ war ]---------------------------------
Downloading from jaspersoft-third-party: https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/org/itech/dataexport-api/0.0.0.7/dataexport-api-0.0.0.7.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/itech/dataexport-api/0.0.0.7/dataexport-api-0.0.0.7.pom
[WARNING] The POM for org.itech:dataexport-api:jar:0.0.0.7 is missing, no dependency information available
Downloading from jaspersoft-third-party: https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/net/minidev/json-smart/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml
Downloading from shibboleth-repo: https://build.shibboleth.net/nexus/content/repositories/releases/net/minidev/json-smart/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml (1.3 kB at 20 kB/s)
Downloading from jaspersoft-third-party: https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/org/itech/dataexport-api/0.0.0.7/dataexport-api-0.0.0.7.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/itech/dataexport-api/0.0.0.7/dataexport-api-0.0.0.7.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.166 s
[INFO] Finished at: 2023-11-02T17:52:03-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project openelisglobal: Could not resolve dependencies for project org.openelisglobal:openelisglobal:war:2.7.3.4: The following artifacts could not be resolved: org.itech:dataexport-api:jar:0.0.0.7 (absent): Could not find artifact org.itech:dataexport-api:jar:0.0.0.7 in jaspersoft-third-party (https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Please help!

I should also mention that I am using VS Code on macOS to run OpenElis. It works fine to call docker-compose up -d on the site as is. My goal is to modify src/main/resources/static/css/openElisCore.css and some images and see the result. Currently after changing openElisCore.css and calling docker-compose stop and docker-compose up -d, I don’t see the modifications I made.

Hello @David_Griffith ,
Replied you on the other

Hi,

I’m trying to customize the legacy jsp front end.

Thanks,

David Griffith
Technical Project Manager
LiveSwitch Inc. (Formerly Frozen Mountain)
Direct: (604) 259-2931
Toll-Free: 888-379-6686
www.liveswitch.com

docker-compose up -d runs with already deployed images to a docker registry.

You can try running with docker-compose -f build.docker-compose.yml up -d to rebuild the images from source code .

When I try that command, the build fails with the following error:
failed to solve: process "/bin/sh -c mvn clean install -DskipTests" did not complete successfully: exit code: 1
Do you have any suggestions on how to fix this error?

Hey @David_Griffith ,
Sorry about that.
The build runs fine in the CI environment

Can you try running mvn clean install -DskipTests on your local machine if you have maven installed??
Probably you have some breaking change locally.

I get the following error when I run mvn clean install -DskipTests. It looks like I’m missing artifacts.

[WARNING] The POM for org.itech:dataexport-api:jar:0.0.0.7 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.053 s
[INFO] Finished at: 2023-11-09T01:02:42-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project openelisglobal: Could not resolve dependencies for project org.openelisglobal:openelisglobal:war:2.7.3.4: The following artifacts could not be resolved: org.itech:dataexport-api:jar:0.0.0.7 (absent): org.itech:dataexport-api:jar:0.0.0.7 was not found in https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of jaspersoft-third-party has elapsed or updates are forced -> [Help 1]

I looked in the .m2/repository folder and .m2/repository/org/itech/dataexport-api didn’t exist so
I cloned dataexport projec and ran mvn clean install with it, but that only has version 0.0.0.2 and OpenElis calls for version 0.0.0.7 according to its pom.xml. Where can I get dataexport-api-0.0.0.2.jar?

The DataExport-api is included in the OpenELIS Global repo as a git submodule.

To clone and Install the submodule locally ,

  1. git submodule update --init --recursive
  2. cd dataexport
  3. mvn clean install

Note . The above will clone the right dataexport version ie 0.0.0.7

I updated the instructions a bit ,
You can do the maven build locally and just mount the war file as a volume to the docker-container .

That way you don’t have to entirely do a local docker build as it often takes longer

1 Like

Hi @Moses_Mutesasira,

Thank you for all your help. It turns out I was on the master branch. After switching to the develop branch, I was able to build the site from the source as expected.

1 Like

Hi @Moses_Mutesasira, I am making small changes to the css files and then running docker-compose -f build.docker-compose.yml up -d --build to see my changes. This works, however the build process takes some time because it is downloading a lot of files from https://repo.maven.apache.org every time. Is there a way to speed this up and just build and deploy the local resources?

Just run with the docker-compose file that pulls pre published images and directly mount the compiled war file into the existing containers .
You don’t need to rebuild the images

docker-compose up -d

Thank you! I appreciate the help :slight_smile:

Hi,
I was trying to setup OpenELIS_Global-2 by cloning the repository.
It seems there is one dependency org.itech.dataexport-api that is creating a problem during mvn clean install -DskipTests command. The screenshot is attached below.
Thanks.

hey @Prajjwal_Kohli just a heads up, I have faced this error before but in my own experience it was a version of JDK that was failing the compilation so suggest you run and make sure you have openjdk version “11.0.21”

java -version

@Moses_Mutesasira

Thanks @Agaba_Derrick_Junior, I checked out the channel dedicated to this issue and it was resolved.

Hey @Prajjwal_Kohli which channel did you refer because I am also facing the same problem

@Rishikesh_Banerjee

The solution is to point JAVA_HOME to java 11.0.21 jdk path.

Thank you @Prajjwal_Kohli