Set shared.loader with MAVEN2_CLASSPATH_CONTAINER
Is there a way to set the shared.loader c开发者_如何学运维atalina.properties variable with the MAVEN2_CLASSPATH_CONTAINER value?
I want to add the library dependencies of a maven eclipse project to that variable. I can add a VM argument to my tomcat launch configuration which can contain a value that is usable within the catalina.properties (similar to -Dcatalina.home=..) but i don't know how to get a usable variable from the org.maven.ide.eclipse.MAVEN2_CLASSPATH Library Container or export it in any way.
I now use a eclipse maven task that executes dependency:dependency-copy for my project.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/mavendependencies</outputDirectory>
<excludeArtifactIds>jsp-api,servlet-api</excludeArtifactIds>
</configuration>
</plugin>
I set the workspace.dir property within my server launch configuration like this:
-Dworkspace.dir=${workspace_loc}
My shared.loader within catalina.properties looks now like this:
shared.loader=${workspace.dir}/project/target/classes,${workspace.dir}/project/target/mavendependencies/*.jar,${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
It is also possible to overwrite the catalina.properties file location using the catalina.config property. In this case no catalina.properties file that has been generated by eclipse must be touched and the shared classloader can be modified by creating a custom file in your project.
-Dcatalina.config=file://${workspace_loc}/projectA/projectA-config/src/main/eclipse-conf/catalina.properties
精彩评论