This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Help witn Maven resources tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Help witn Maven resources tag" Watch "Help witn Maven resources tag" New topic
Author

Help witn Maven resources tag

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Hi Guys,

I need some help with Maven resources tag. I'm trying to acheive the following,

I want to load my jndi.properties file whch has 3 name=value pairs, one for the weblogic server url, the username and password. Now in my settings.xml file, I have added a profile as below,


And in my pom.xml, I say the following,



But when I bring up my application after deployment and when I try to access my session bean, I simply get for the url "${jndi.url}" and not the replaced http://localhost:7001/console.

Any reasons why? Please help me.


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

I forgot to paste my jndi.properties,

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

Guya, any idea on this please?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5575

I used your files to update one of my projects, and ran maven using:

mvn -P WeblogicJNDI package

The resulting jndi.properties file contained:

url="http://localhost:7001/console"
user="weblogic"
pass="weblogic"

Are you certain that you spelled the profile name properly on the command line? It is case sensitive.


JBoss In Action
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5575

Oh, just noticed that activeByDefault is set to true on the profile. Tried again with:

mvn clean package

Same result - the jndi.properties files has the expected settings.
Craig Tataryn
Greenhorn

Joined: Nov 30, 2004
Posts: 1
Sorry, I realize this post is a year old but for prosperity's sake:



Flip that to "true" and you will be good to go.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5575

Good eyes, Craig! I always have filtering set to true so I probably just missed that.

Oh, and welcome to Java Ranch!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Help witn Maven resources tag
 
Similar Threads
Ear Building in Maven
Maven - Selecting the certain resource files into WAR from the default src/main/resources location
How to copy file.jks KEEPING ORIGINAL FILE DATE in maven
maven war package corrupts jar import
Error assembling WAR: webxml attribute is required