Thanks a lot for your reply. I tried to use your way, but:

1. I already have a test folder under 'src' (scr/main and src/test which is
a standard Maven project structure).
2. I didn't really understand (sorry for that, - I'm not a Maven Guru :( )
the syntax to use in case of test prefix. I'd like to set up 4 different
environment with their corresponding properties.
3. I put a properties file 'app.properties' in scr/test/resources with the
following content:

host={test.host}

4. Tried to get properties in a java class as follows:

public Person() {        
        initProperies();
        System.out.println("Got system properties: " +
properties.getProperty("host"));
    }
    
    private void initProperies(){
        properties = new Properties();
        try {
            properties.load(new FileInputStream("app.properties"));
        } catch (IOException ex) {
            Logger.getLogger(Person.class.getName()).log(Level.SEVERE, null,
ex);
        }
    }

5. Got the FileNotFoundException when running 'mvn clean test' command.

Any idea how to:
- separate all the 4 profiles
- get the needed values in a Java class

Thanks in advance.







--
View this message in context: 
http://maven.40175.n5.nabble.com/Getting-profile-settings-values-in-a-Java-class-tp5722740p5722845.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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

Reply via email to