My requirement is, when i build a project with 'dev' profile(mvn clean install -Pdev) on that time I need to disable some of the features. if profile is not 'dev' then no need to remove those features. this my root pom.xml,
<profile>
<id>dev</id>
<modules>
<module>../cmn/module1</module>
<module>../cmn/module2</module>
<module>../cmn/module3</module>
</modules>
</profile>
i have to disable some features on module3(this having separate pom.xml). and I am pasting here Sample feature that needs to be disabled when profile is 'dev',
@Configuration
public class Sample{
}
I came to know that @Profile is the right annotation to disable some features, and then I have modified the class to something like the below,
@Configuration
@Profile("!dev")
public class Sample{
}
'!dev' means this feature is disabled for profile 'dev', other than 'dev' it should be enabled. but with @Profile("!dev") the feature is not disabled. i have build the project with 'mvn clean install -Pdev'. still the project has the feature Sample.
what is wrong with me? how can I disable the Sample feature when my project is build with 'dev' profile?
Thanks in advance...