Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

后端项目多模块项目,新建项目中的controller没有打包运行 #373

Closed
liudonghua123 opened this issue Aug 2, 2019 · 5 comments

Comments

@liudonghua123
Copy link
Contributor

liudonghua123 commented Aug 2, 2019

版本号:

2.0.2

问题描述:

参考 http://jeecg-boot.mydoc.io/?t=345671 这里的文档说明,我新建了一个新的maven模块 jeecg-boot-module-jm,在 jeecg-boot-module-system 中依赖这个模块,但是运行的时候 jeecg-boot-module-jm 模块中的controller没有显示在swagger-ui中,而且也不能访问

新模块的pom.xml 文件内容如下

<project xmlns="http://maven.apache.org/POM/4.0.0"
		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>jeecg-boot-module-jm</artifactId>
	<version>2.0.2</version>

	<parent>
		<groupId>org.jeecgframework.boot</groupId>
		<artifactId>jeecg-boot-parent</artifactId>
		<version>2.0.2</version>
	</parent>

	<dependencies>
		<dependency>
			<groupId>org.jeecgframework.boot</groupId>
			<artifactId>jeecg-boot-base-common</artifactId>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>aliyun</id>
			<name>aliyun Repository</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<repository>
			<id>jeecg</id>
			<name>jeecg Repository</name>
			<url>http://maven.jeecg.org/nexus/content/repositories/jeecg</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

</project>

目录结构如下

image

@zhangdaiscott
Copy link
Member

描述太简单,无法判断

@chengtg
Copy link

chengtg commented Aug 5, 2019

可以参考下,这篇博客https://my.oschina.net/u/3903209/blog/3083399

@jeromexf
Copy link

新建模块的包名不是org.jeecg开头的应该这么配置

@liudonghua123
Copy link
Contributor Author

@jeromexf 只需要在Spring boot的@componentscan中添加你需要扫描的包名就可以了,可以参考
https://www.baeldung.com/spring-component-scanning
https://www.springboottutorial.com/spring-boot-and-component-scan

@petma
Copy link

petma commented Mar 17, 2020

还需要修改 Swagger2Config类中createRestApi方法,让其可以扫描其它包

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants