If you really need to do this, you can configure exceptions in pom.
eg. here is an example of an exception in one of my priests where I do not want it to automatically receive sharing messages because I use a different logging provider.
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${org.springframework-version}</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> </dependency>
You can do something like this (untested)
<dependency> <groupId>com.package</groupId> <artifactId>module-2</artifactId> <exclusions> <exclusion> <groupId>com.package</groupId> <artifactId>module-1</artifactId> </exclusion> </exclusions> </dependency>
I would not recommend this. This makes sense in case of my registration exception, because I use slf4j instead of registering in communities. I saw other examples when this is used to exclude spring 2 if the project as a whole uses spring 3.
This is a little hard to say from your example, because it is so vague. In general, you should keep your addictions to a minimum. If module-2 depends on module-1, then this means that your application will not compile or run without module-1. If in fact he can live happily without him, then this is not very dependent.
As a side note, it's a little worrying that you don't have a version number for dependencies. You will probably find that maven is warning you about this. It is good practice to always include the version number. If you depend on a module that is currently under development, you must use the suffix .SNAPSHOT for the version to get the latest version for this version.
Ben Thurley Oct. 15 '13 at 16:13 2013-10-15 16:13
source share