NutzCN Logo
问答 maven 接口entity抽取问题
发布于 2461天前 作者 qq_e25320ed 1585 次浏览 复制 上一个帖子 下一个帖子
标签:

假设有项目ParentProject,其中里面有一些entity和interface等,发布独立的工程Entity-ParentProject。
Entity-ParentProject的内容自动从ParentProject的复制。提供给其他项目作为依赖使用。
1、现在的解决方案是利用maven的maven-resources-plugin插件做。抽取绑定在Entity-ParentProject 的install项目周期上。
但是现在希望的是修改ParentProject的entity的时候能自动拷贝到Entity-ParentProject中。
有别的解决思路吗?

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-resources-plugin</artifactId>
	<version>2.6</version>
	<configuration>
		<encoding>${project.build.sourceEncoding}</encoding>
	</configuration>
	<executions>
		<execution>
			<!-- 集中不同项目实体类定义 -->
			<id>copy-resources</id>
			<!-- here the phase you need -->
			<phase>install</phase>
			<goals>
				<goal>copy-resources</goal>
			</goals>
			<configuration>
				<outputDirectory>${basedir}/src</outputDirectory>
				<resources>		
					<resource>
						<directory>../ParentProject/src</directory>
						<includes>
							<include>**/entity/*.*</include>
							<include>**/entity/service/*.*</include>
							<include>**/entity/table/*.*</include>
							<include>**/interfaces/*.*</include>
						</includes>									
					</resource>
				</resources>
			</configuration>
		</execution>
	</executions>
</plugin>
2 回复

写个maven plugin为所欲为

建议很不错,我先想想怎么做,谢了。

添加回复
请先登陆
回到顶部