• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help witn Maven resources tag

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to paste my jndi.properties,

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guya, any idea on this please?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good eyes, Craig! I always have filtering set to true so I probably just missed that.

Oh, and welcome to Java Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic