Set up plugins in CableMES
Go to IntelliJ and use File → New → Project From Version control download the project for the specific plugin you want. Use the GIT repository!
After the Plugin is opened in a new project run Maven commands:
clean
install
If it does not build ask someone for help!
Modify Tomcat to accept the plugin:
Go to \your_tomcat_directory\conf\ and open the context.xml file in the editor using Administrator privileges so you can save changes.
inside <Context></Context> tags check if you already have <Resources className="org.apache.catalina.webresources.StandardRoot"></Resources> tags. If not then add them.
inside the tags form above add the paths to the target and resource folders from the plugin project:
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="/plugin_Name/target/classes" webAppMount="/WEB-INF/classes"/>
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:/Projects/plugin_Name/target/classes/META-INF/resources" webAppMount="/"/>Save the changes! And restart Tomcat to read the modified context!
My sample context file (for comparison) looks like:
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!--<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>-->
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
<Resource auth="Container" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" maxActive="10" maxIdle="30" maxWait="10000" name="jdbc/CableMES" password="CableMES" type="javax.sql.DataSource" url="jdbc:sqlserver://localhost:1433;database=CableMESdev" username="CableMES"/>
<Resource name="jdbc/opcAlarms" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="aaAlarms" password="aaAlarms" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://DEV2:1433;databaseName=A2ALMDB"/>
<Resource name="jdbc/opcHistory" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="aaRuntime" password="aaRuntime" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://DEV2:1433;databaseName=Runtime"/>
<!-- PLUGIN RESOURCES -->
<Resources className="org.apache.catalina.webresources.StandardRoot">
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:/Projects/CableMESplugins/NEWTLabels/target/classes" webAppMount="/WEB-INF/classes"/>
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:/Projects/CableMESplugins/NEWTLabels/target/classes/META-INF/resources" webAppMount="/"/>
<!-- CableBuilderItemRouting Plugin -->
<!--
<JarResources className="org.apache.catalina.webresources.DirResourceSet" base="E:\\Projects\CableMESPlugin_CableBuilderItemRouting\target\classes"
webAppMount="/WEB-INF/classes" />-->
</Resources>
</Context>