MIR (acronym for MyCoRe/MODS Institutional Repository) is an open source repository software that is build upon MyCoRe and MODS.
Detailed instructions for application usage you can find on MIR Documentation site.
This guide addresses developers. Thats why you run it in 'dev' profile!
- run
mvn clean install -am -pl mir-webapp
in mir folder - add profile
dev
to your.m2/settings.xml
including path to solr home and solr data
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<mir.solr.home>${user.home}/.mycore/dev-mir/data/solr</mir.solr.home>
<mir.solr.data.dir>${user.home}/.mycore/dev-mir/data/solr/data</mir.solr.data.dir>
</properties>
</profile>
- initialize solr configuration using
git submodule update --init --recursive
- to start solr, go to mir-webapp
- install solr with the command:
mvn -Pdev solr-runner:copyHome
- run solr with the command:
mvn -Pdev solr-runner:start
- stop solr with the command:
mvn -Pdev solr-runner:stop
- update solr with the command:
mvn -Pdev solr-runner:stop solr-runner:copyHome solr-runner:start
- to starting up a servlet container in development environment go back to mir folder
- run
mvn install -am -pl mir-webapp && mvn -Pdev -Dtomcat org.codehaus.cargo:cargo-maven3-plugin:run -pl mir-webapp
- Installation hangs while generating secret
There is entropy missing for GPG key generation. For ubuntu eg. you can use rng-tools:
apt-get install rng-tools
rngd -r /dev/urandom
- Can't export using bibtex button on metadata page
install bibutils - How can I use MyCoRe command line interface (not WebCLI)?
mir-cli/target/appassembler/bin/mir.sh
SetJAVA_OPTS
environment variable to-DMCR.DataPrefix=dev
before running. - How can I get more than one connection to h2?
add;AUTO_SERVER=TRUE
in jdbc url (configured in persistence.xml)
The docker container has its own install script which uses the environment variables.
Property | Default, required | Description |
---|---|---|
SOLR_URL | none, required | The URL to the SOLR Server. Same as MCR.Solr.ServerURL in mycore.properties. |
SOLR_CORE | mir | The name of the Solr main core. Same as MCR.Solr.Core.main.Name in mycore.properties. |
SOLR_CLASSIFICATION_CORE | mir-classifications | The name of the Solr classification core. Same as MCR.Solr.Core.classification.Name in mycore.properties. |
JDBC_NAME | none, required | The username for the Database authentication. Same as javax.persistence.jdbc.user in persistence.xml. |
JDBC_PASSWORD | none, required | The password for the Database authentication. Same as javax.persistence.jdbc.password in persistence.xml. |
JDBC_DRIVER | none, required | The driver for the Database. Same as javax.persistence.jdbc.driver in persistence.xml. If you use org.postgresql.Driver, org.mariadb.jdbc.Driver, org.hsqldb.jdbcDriver, org.h2.Driver or com.mysql.jdbc.Driver the right database drivers get downloaded by the installer script. |
JDBC_URL | none, required | The url for the Database. |
JDBC_SCHEMA | public | The schema for the Database. Same as hibernate.default_schema in persistence.xml. |
APP_CONTEXT | mir | The url context in which the app lives. (The .war will be renamed to the $APP_CONTEXT.war) |
MCR_CONFIG_DIR | /mcr/home/ | The location for the home directory. Same as the MCR.ConfigDir . |
MCR_DATA_DIR | /mcr/data/ | The location for the data directory. Same as MCR.datadir in mycore.properties. |
XMX | 1g | The value of the -Xmx parameter for Tomcat. |
XMS | 1g | The value of the -Xms parameter for Tomcat. |
FIX_FILE_SYSTEM_RIGHTS | false | If true the file system rights of the mounted volumes get corrected to be owned by the right user. |
MIR_OPTS | Additional options which will be passed as JAVA_OPTS to the tomcat process |
The paths in MCR_CONFIG_DIR
and MCR_DATA_DIR
should be mounted. Default values are /mcr/home/
and /mcr/data/
.
When starting the container the first time you may receive errors like
java.io.FileNotFoundException: /mcr/home/mycore.active.properties (Permission denied)
this is because the container
runs as user mcr
and the mounted volumes are owned by root
.
To fix this you can set the docker property FIX_FILE_SYSTEM_RIGHTS
to true
. This will change the owner of the
mounted volumes to mcr
and the container will start without errors.
The docker container creates the required solr cores if they do not exist.
The path /var/solr/data
should be mounted, it contains all persistent data.
There is an example docker-compose.yml which can be used for local development. The ports and other settings can be changed in the .env file. You can use the commands:
mvn clean install -Pdev -Dtomcat clean install && docker-compose up --build
There is another example docker-compose.prod.yml which uses prebuild images which are stored at dockerhub. You can start them with the commands:
docker-compose -f docker-compose.prod.yml up
It's strongly recommended to add a reverse proxy like Apache or Nginx in front.
For the moment see agis-:Git-Style-Guide and use it with the following exceptions:
- Subject to commits is in form:
{JIRA-Ticket} {Ticket summary} {Commit summary}
, likeMIR-526 Git-Migration add .travis.yml
- Branch name to work on a ticket is in form:
issues/{JIRA-Ticket}-{Ticket_Summary}
, likeissues/MIR-526-Git_Migration
Stay tuned for more information. 🙇