You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/12/18 16:57:02 UTC

[OT] Where to store classpath resources outside of WAR

When deploying a WAR file whose code uses information stored in classpath
configuration resources, where should you store these configuration files if
outside of the WAR file?

If you want to keep these configuration files outside of the WAR file to
make for easier deployment in multiple environments, isn't the only other
classpath available to Tomcat within its own lib folder? And in that case,
the configuration file would be available in all contexts. So where should
such a file be stored (i.e. available to the webapp as a resource but not
available to all contexts)?

Thanks.
-- 
View this message in context: http://www.nabble.com/-OT--Where-to-store-classpath-resources-outside-of-WAR-tp14399810p14399810.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: maven.proxy.nonProxyHosts

Posted by Romain Gilles <Ro...@reuters.com>.
You can try to create an internal repository. This internal repository
will be your only one entry point (i.e.
maven.repo.remote=http://myintermalrepo.mycompany:8080)
And you will not have to use the proxy configuration.



Romain Gilles
Development Software Engineer
Reuters 

(t) +33 (0)1 47 62 77 41 

romain.gilles@reuters.com
Reuters Messaging: romain.gilles.reuters.com@reuters.net

Reuters news and information reaches one billion people every day. Get
the latest news at Reuters.com 


-----Original Message-----
From: Dooing@gmx.de [mailto:Dooing@gmx.de] 
Sent: 21 December 2007 10:45
To: users@maven.apache.org
Subject: maven.proxy.nonProxyHosts

Hi, 

using Maven 1.1, I've read there was an option to use a proxy and also
to exclude special urls from it - for internet connections, we need to
use a proxy, but for our maven repo on the LAN we don't.

However, this:
maven.repo.remote=http://192.168.0.54, http://www.ibiblio.org/maven
maven.proxy.host=MY_PROXY_SERVER_URL
maven.proxy.port=8080
maven.proxy.nonProxyHosts=http://192.168.0.54

Doesn't seem to work.

Any ideas?

Thanks in advance,

Christine
P.s.: The codeczar tomcat plugin finally works! :-)
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org



This email was sent to you by Reuters, the global news and information company. 
To find out more about Reuters visit www.about.reuters.com

Any views expressed in this message are those of the individual sender, 
except where the sender specifically states them to be the views of Reuters Limited.

Reuters Limited is part of the Reuters Group of companies, of which Reuters Group PLC is the ultimate parent company.
Reuters Group PLC - Registered office address: The Reuters Building, South Colonnade, Canary Wharf, London E14 5EP, United Kingdom
Registered No: 3296375
Registered in England and Wales



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven.proxy.nonProxyHosts

Posted by Do...@gmx.de.
Nope, we don't need a proxy username or password -

plus, the IP I wrote down is the IP that should NOT use a proxy.
When I type in the IP into my browser, I can see the maven repository.
And when I remove the proxy setting it also works in Maven.

With these settings:
maven.repo.remote=http://192.168.0.54
maven.proxy.nonProxyHosts=http://192.168.0.54
#maven.proxy.host=MYPROXY
#maven.proxy.port=8080

It works (but then the urls that need a proxy don't work anymore...)

maven tomcat:deploy
Trying to get missing dependencies (and updated snapshots) required by MYPROJECT:
- Attempting to download MYFOLDER:MYDEPENDENCY:jar from http://192.168.0.54
70K downloaded

Well, actually, I am just thinking - the IP I wrote down needs to be tunneled in a VPN. But when I am in the VPN tunnel, should that also apply for Maven? In Tomcat I added noProxy Settings like this:

http.proxyPort=8080
http.proxyHost=MYPROXY
http.nonProxyHosts=localhost||192.168.*

And with Tomcat it does work that way.

Thanks in advance,

Christine
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven.proxy.nonProxyHosts

Posted by Lukas Theussl <lt...@apache.org>.
Well, that must be a permission problem, check your server logs, maybe 
just a wrong pwd (don't you need maven.proxy.password?), or wrong 
directory permissions?

And yes, I can confirm that maven.proxy.nonProxyHosts is an existing 
property [1] and that it is used by DependencyVerifier, even though I 
couldn't find it documented anywhere... ;)

Cheers,
-Lukas

[1] http://maven.apache.org/maven-1.x/apidocs/constant-values.html


Dooing@gmx.de wrote:
>>You are right, the http is correct actually. Another guess: replace the 
>>IP name by a DNS name? But you will have to tell us more details about 
>>the problem, just saying it doesn't work doesn't leave me a lot of
>>clues...
> 
> 
> Well, actually, using a DNS name is just what I really want and so what I tried in the first place (but as I am not sure whether or not Maven uses my Windows hosts file, I tried the hardcoded IP adress instead).
> 
> In my user home in my build.properties file I got:
> maven.repo.local=C:/MYFOLDER/Maven1.1/repository
> maven.home.local=C:/MYFOLDER/Maven1.1
> maven.repo.remote=http://192.168.0.54
> maven.proxy.nonProxyHosts=http://192.168.0.54
> maven.proxy.host=MYPROXY_SERVER
> maven.proxy.port=8080
> 
> 
> Then I typed in:
> 
> maven tomcat:deploy
> 
> Which results in:
>  __  __
> |  \/  |__ _Apache__ ___
> | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
> |_|  |_\__,_|\_/\___|_||_|  v. 1.1
> 
> Trying to get missing dependencies (and updated snapshots) required by MYWEBAPP:
> - Attempting to download MYDEPENDENCY:jar from http://192.168.0.54
> Error retrieving artifact from [http://192.168.0.54]: org.apache.maven.wagon.authorization.AuthorizationException: 
> Access denied to: http://192.168.0.54//MYFOLDER/jars/MYDEPENDENCY.jar
> -------------------------------------------------------------------------------
> 
>>>The build cannot continue because of the following unsatisfied dependency:
> 
> - MYFOLDER:MYDEPENDENCY-1.1.jar
> 
> -------------------------------------------------------------------------------
> BUILD FAILED
> -------------------------------------------------------------------------------
> 
> Hope this helps to help me! ;-)
> 
> What I would like to know: As it was quite hard to actually find the nonProxy property setting, could it be that it doesn't even exist? In other words, can you confirm that using Maven 1.1 the setting "maven.proxy.nonProxyHosts" actually exists and should be working???
> 
> Thanks,
> 
> Christine
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven.proxy.nonProxyHosts

Posted by Do...@gmx.de.
> You are right, the http is correct actually. Another guess: replace the 
> IP name by a DNS name? But you will have to tell us more details about 
> the problem, just saying it doesn't work doesn't leave me a lot of
> clues...

Well, actually, using a DNS name is just what I really want and so what I tried in the first place (but as I am not sure whether or not Maven uses my Windows hosts file, I tried the hardcoded IP adress instead).

In my user home in my build.properties file I got:
maven.repo.local=C:/MYFOLDER/Maven1.1/repository
maven.home.local=C:/MYFOLDER/Maven1.1
maven.repo.remote=http://192.168.0.54
maven.proxy.nonProxyHosts=http://192.168.0.54
maven.proxy.host=MYPROXY_SERVER
maven.proxy.port=8080


Then I typed in:

maven tomcat:deploy

Which results in:
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.1

Trying to get missing dependencies (and updated snapshots) required by MYWEBAPP:
- Attempting to download MYDEPENDENCY:jar from http://192.168.0.54
Error retrieving artifact from [http://192.168.0.54]: org.apache.maven.wagon.authorization.AuthorizationException: 
Access denied to: http://192.168.0.54//MYFOLDER/jars/MYDEPENDENCY.jar
-------------------------------------------------------------------------------
>> The build cannot continue because of the following unsatisfied dependency:
- MYFOLDER:MYDEPENDENCY-1.1.jar

-------------------------------------------------------------------------------
BUILD FAILED
-------------------------------------------------------------------------------

Hope this helps to help me! ;-)

What I would like to know: As it was quite hard to actually find the nonProxy property setting, could it be that it doesn't even exist? In other words, can you confirm that using Maven 1.1 the setting "maven.proxy.nonProxyHosts" actually exists and should be working???

Thanks,

Christine


-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven.proxy.nonProxyHosts

Posted by Lukas Theussl <lt...@apache.org>.
You are right, the http is correct actually. Another guess: replace the 
IP name by a DNS name? But you will have to tell us more details about 
the problem, just saying it doesn't work doesn't leave me a lot of clues...

-Lukas


Dooing@gmx.de wrote:
>>Try removing the http:
> 
> 
> Yeah, I tried that - then Maven even complains that the protocol is missing (plus it doesn't work either)
> 
> -----
> 
> Only using a local repository isn't an option either - we are a big developer team, distributed over various locations, and there will always be someone forgetting to upload a file to our local repo, plus the proxy isn't required by everyone - those who don't need it don't care and say "it's on the web, just make Maven get it there..."
> 
> 
>>And would you share how you made the tomcat plugin work? Maybe other 
>>users could still profit from it. :)
> 
> 
> Well, I am ashamed, that's why I didn't want to in the first place.
> Well, well, well ;-). It would have worked, if I had also changed the tomcat dependencies to Version 5.5.12 instead of ONLY replacing my running Tomcat.
> 
> Christine
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven.proxy.nonProxyHosts

Posted by Do...@gmx.de.
>Try removing the http:

Yeah, I tried that - then Maven even complains that the protocol is missing (plus it doesn't work either)

-----

Only using a local repository isn't an option either - we are a big developer team, distributed over various locations, and there will always be someone forgetting to upload a file to our local repo, plus the proxy isn't required by everyone - those who don't need it don't care and say "it's on the web, just make Maven get it there..."

> And would you share how you made the tomcat plugin work? Maybe other 
> users could still profit from it. :)

Well, I am ashamed, that's why I didn't want to in the first place.
Well, well, well ;-). It would have worked, if I had also changed the tomcat dependencies to Version 5.5.12 instead of ONLY replacing my running Tomcat.

Christine

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven.proxy.nonProxyHosts

Posted by Lukas Theussl <lt...@apache.org>.
Try removing the http:

maven.proxy.nonProxyHosts=192.168.0.54

And would you share how you made the tomcat plugin work? Maybe other 
users could still profit from it. :)

Thanks,
-Lukas


Dooing@gmx.de wrote:
> Hi, 
> 
> using Maven 1.1, I've read there was an option to use a proxy and also to exclude special urls from it - for internet connections, we need to use a proxy, but for our maven repo on the LAN we don't.
> 
> However, this:
> maven.repo.remote=http://192.168.0.54, http://www.ibiblio.org/maven
> maven.proxy.host=MY_PROXY_SERVER_URL
> maven.proxy.port=8080
> maven.proxy.nonProxyHosts=http://192.168.0.54
> 
> Doesn't seem to work.
> 
> Any ideas?
> 
> Thanks in advance,
> 
> Christine
> P.s.: The codeczar tomcat plugin finally works! :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


maven.proxy.nonProxyHosts

Posted by Do...@gmx.de.
Hi, 

using Maven 1.1, I've read there was an option to use a proxy and also to exclude special urls from it - for internet connections, we need to use a proxy, but for our maven repo on the LAN we don't.

However, this:
maven.repo.remote=http://192.168.0.54, http://www.ibiblio.org/maven
maven.proxy.host=MY_PROXY_SERVER_URL
maven.proxy.port=8080
maven.proxy.nonProxyHosts=http://192.168.0.54

Doesn't seem to work.

Any ideas?

Thanks in advance,

Christine
P.s.: The codeczar tomcat plugin finally works! :-)
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Where to store classpath resources outside of WAR

Posted by David Delbecq <de...@oma.be>.
In custom context.xml, you can define the ressource, that is mainly 
Datasources that are linked with jndi. Just define a datasource and 
store your config in the database. Or if you want more complicated 
things, store other tyes of objects in your jndi, by defining them in 
your context.xml.

Note that, even if you provide a custom context.xml, this one will be 
overriden by the one in META-INF/context.xml during deployement of 
webapp! In general, i would say, if you want to store things outside the 
war, just make it accessible either from database or from JNDI.

As to your suggestion, i think it will bring more complexity and is more 
error prone than embedding config in war. Some commercial application i 
have seen (JIRA for example), just provide a folder you unpack on your 
development station, you configure it, then type "ant war" and you get a 
ready to deploy webapp. No need to tocuh anything server side.


lightbulb432 wrote:
> Similar to how you can specify an mycontext.xml in conf/Catalina/localhost to
> specify the context without having to modify prepackaged WAR files, can you
> so something like place files in context-specific folders (i.e.
> conf/Catalina/localhost/mycontext/resource1.properties) that would be
> accessible from the classpath of the web app?
>
> If it doesn't exist, would it be a good feature request? It would accomplish
> multiple things:
> - Wouldn't expose the classpath resources to more web applications than
> intended (which would be the case if you put it in CATALINA_HOME/lib).
> - Would allow deployers to not have to modify the web.xml and place the
> classpath resource in WEB-INF/classes or WEB-INF/lib.
> - Would prevent developers from having to code using absolute filenames.
>
> First of all, is a feature similar to what I'm suggesting available in
> Tomcat? If not, what do you think of such a feature request?
>
> Thanks.
>
>
>
> lightbulb432 wrote:
>   
>> When deploying a WAR file whose code uses information stored in classpath
>> configuration resources, where should you store these configuration files
>> if outside of the WAR file?
>>
>> If you want to keep these configuration files outside of the WAR file to
>> make for easier deployment in multiple environments, isn't the only other
>> classpath available to Tomcat within its own lib folder? And in that case,
>> the configuration file would be available in all contexts. So where should
>> such a file be stored (i.e. available to the webapp as a resource but not
>> available to all contexts)?
>>
>> Thanks.
>>
>>     
>
>   


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


Re: Where to store classpath resources outside of WAR

Posted by lightbulb432 <ve...@hotmail.com>.
Similar to how you can specify an mycontext.xml in conf/Catalina/localhost to
specify the context without having to modify prepackaged WAR files, can you
so something like place files in context-specific folders (i.e.
conf/Catalina/localhost/mycontext/resource1.properties) that would be
accessible from the classpath of the web app?

If it doesn't exist, would it be a good feature request? It would accomplish
multiple things:
- Wouldn't expose the classpath resources to more web applications than
intended (which would be the case if you put it in CATALINA_HOME/lib).
- Would allow deployers to not have to modify the web.xml and place the
classpath resource in WEB-INF/classes or WEB-INF/lib.
- Would prevent developers from having to code using absolute filenames.

First of all, is a feature similar to what I'm suggesting available in
Tomcat? If not, what do you think of such a feature request?

Thanks.



lightbulb432 wrote:
> 
> When deploying a WAR file whose code uses information stored in classpath
> configuration resources, where should you store these configuration files
> if outside of the WAR file?
> 
> If you want to keep these configuration files outside of the WAR file to
> make for easier deployment in multiple environments, isn't the only other
> classpath available to Tomcat within its own lib folder? And in that case,
> the configuration file would be available in all contexts. So where should
> such a file be stored (i.e. available to the webapp as a resource but not
> available to all contexts)?
> 
> Thanks.
> 

-- 
View this message in context: http://www.nabble.com/-OT--Where-to-store-classpath-resources-outside-of-WAR-tp14399810p14445789.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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