I am quite new to Maven and Java EE programming all-together.
I would like to create a stub class for authentication testing which should be activated in the default Ma
It is possible, with some footwork. You will have to put your class(es) in a dependency and use the profiles in this manner:
<profiles>
<profile>
<id>default</id>
<dependencies>
<dependency>...</dependency>
</dependencies>
</profile>
<profile>
<id>someotherprofile</id>
<dependencies>
<dependency>...</dependency>
</dependencies>
</profile>
</profiles>
Also, the classes will have to be in the same package for this to work.
Cheers,
You can specify the concrete class in a property file, and filter property files by maven build profile, so they would get different values. Property file would then be read by java code and it would be used accordingly.
Is there some reason to do this? It doesn't feel like the right way of doing things...