Maven question about commons-dbcp

Support and Announcements for the LDS Tech Java Web Application Platform (setup, configuration, bugs, feedback).
pauldev
New Member
Posts: 28
Joined: Mon Jan 07, 2013 12:42 pm

Maven question about commons-dbcp

Postby pauldev » Wed Jan 23, 2013 11:49 am

Q: I notice that in the training it shows how to setup a datasource using jndi...
Is it better to use spring to create a datasource bean?

Anyway, trying to use commons-dbcp to test out creating a datasource spring bean I get a maven error:
I am trying to add a dependency to my -web pom.xml:
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>

I get this error:
Failure to find commons-dbcp:commons-dbcp:jar:1.4 in http://code.lds.org/nexus/content/groups/main-repo

So what I am trying to figure out is why it is not in nexus? (or just how to force maven to use the default repository)

YoungstromMJ
Member
Posts: 100
Joined: Mon Mar 29, 2010 2:11 pm
Location: Utah, USA

Re: Maven question about commons-dbcp

Postby YoungstromMJ » Wed Jan 23, 2013 1:58 pm

to answer your first question.

Traditionally we've preferred setting up datasources in the server.xml file and then referencing them through jndi because it allows the ASEs more visibility and ability to change the applications connection to the database.

As use of Tomcat has matured in the organization this has been less and less useful. So I wouldn't be surprised if in some future version of the stack we recommend people embed their datasources in their application. But the standard today is still to put the datasource in your server.xml like it is in our stack-starter applications.

To answer your second question about commons-dbcp. Because commons-dbcp isn't a pool that we've supported in the past and don't have any experience supporting we don't have it approved in our maven repository. We recommend people use tomcat-jdbc instead it is better performing and has some nice features too.

If you still want to use commons-dbcp I can talk to you about the process for approval. If you are just experimenting and don't need it in the official repository then just add a repository entry in your root pom to maven central http://repo1.maven.org/maven2. Just make sure you give it a non typical ID since we block the more common ids (e.g. central, repo1, etc) in our parent pom.

Does that help?

Mike

pauldev
New Member
Posts: 28
Joined: Mon Jan 07, 2013 12:42 pm

Re: Maven question about commons-dbcp

Postby pauldev » Thu Jan 24, 2013 10:16 am

Yes, thanks for the info.


Return to “Java Web Project Support (Stack)”

Who is online

Users browsing this forum: No registered users and 1 guest