java - Changes in dependent modules cannot be seen in other module in Maven Eclipse -
i working on multi module project m2eclipse. set maven take care of resolving workspace dependencies. when make change on, say, service module, change not visible on other modules immediately. if make new method in service layer, not visible in webapp layer. run/maven install , refresh , project/clean , maven/update dependencies doesn't work. can give me idea on problem?
my project structure looks follows:
parent module
<groupid>com.myproject</groupid> <artifactid>einvites-parent</artifactid> <modules> <module>myproject-common</module> <module>myproject-domain</module> <module>myproject-service</module> <module>myproject-web</module> </modules>
service module
<parent> <artifactid>myproject-parent</artifactid> <groupid>com.myproject</groupid> <version>1.0</version> </parent> <groupid>com.myproject</groupid> <artifactid>myproject-service</artifactid>
web module
<parent> <artifactid>myproject-parent</artifactid> <groupid>com.myproject</groupid> <version>1.0</version> </parent> <groupid>com.myproject</groupid> <artifactid>myproject-web</artifactid> <version>1.0</version> <packaging>war</packaging> <name>myproject-web</name> <dependencies> <dependency> <groupid>com.myproject</groupid> <artifactid>myproject-service</artifactid> <version>1.0</version> <type>jar</type> <scope>compile</scope> </dependency> </dependencies>
this supposed work; , me. i'm not sure if fix problem try change pom use snapshot
version i.e. 1.0-snapshot
(you're supposed use snapshot
versions anyway modules under active development).
by way, there lots of unnecessary , redundant stuff in poms. should this:
service module
<project> ... <parent> <artifactid>myproject-parent</artifactid> <groupid>com.myproject</groupid> <version>1.0-snapshot</version> </parent> <!--groupid>com.myproject</groupid--> <!-- no need, inherit --> <artifactid>myproject-service</artifactid> ... </project>
web module
<project> ... <parent> <artifactid>myproject-parent</artifactid> <groupid>com.myproject</groupid> <version>1.0-snapshot</version> </parent> <!--groupid>com.myproject</groupid--> <!-- no need, inherit --> <artifactid>myproject-web</artifactid> <!--version>1.0</version--> <!-- no need, inherit --> <packaging>war</packaging> <name>myproject-web</name> <dependencies> <dependency> <groupid>${project.groupid}</groupid> <!-- use built-in properties instead --> <artifactid>myproject-service</artifactid> <version>${project.version}</version> <!-- use built-in properties instead --> <!--type>jar</type--> <!-- no need, that's default --> <!--scope>compile</scope--> <!-- no need, that's default --> </dependency> </dependencies> ... </project>
Comments
Post a Comment