-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anthony,

Arnone, Anthony wrote:
> I’m trying to set a system where I can deploy a single .war under
> multiple context names (using the ant deploy extensions).

Ooh! I love these things.

> ant -Ddeploy-path=/app-01 deploy
> 
> ant -Ddeploy-path=/app-02 deploy

How about:

ant -Dcontext-name=app-01 deploy
ant -Dcontext-name=app-02 deploy

> <Context>
> 
> <Environment name="solr/home" type="java.lang.String"
> value="webapps/${context.name}/app-01/solr/" override="true" />
> 
> </Context>

Then you can just use:

   <Environment
        name="solr/home"
        type="java.lang.String"
        value="webapps/${context-name}/solr/"
        override="true" />

Make sure that you turn on the appropriate filter when copying (or
generating) your context.xml file so that ${context-name} gets expanded.

> <env-entry>
> 
> <env-entry-name>solr/home</env-entry-name>
> 
> <env-entry-type>java.lang.String</env-entry-type>
> 
> <env-entry-value>
> webapps/${context.name}/app-01/solr/</env-entry-value>
> 
> </env-entry>

Using web.xml might be a little bit more platform-neutral. The strategy
would be the same.

> This allows for a much simpler deployment, where
> no context.xml needs to be generated and packaged into the war at
> deploy time.

Really? How do you deploy a WAR file without a context.xml file? Or, do
you not need Tomcat to provide anything specific like a JNDI data source?

> Unfortunately,  as far as I know, a variable like this
> does not exist. So my question is this, is there a way to specify a
> variable like this relative to the context root?

No, but you can just change the way you think about the variable and
alter your scripts accordingly.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG5wjK9CaO5/Lv0PARAvToAJ4y/phvSQbao1LRnq4oWDbB7gri6wCgtlKC
LDfVpPmTGsi1oqxm0/LN25I=
=WlK0
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to