admin管理员组文章数量:1352974
I'm working on a demo project to practice microservices and their communication. I have already several microservices and I noticed hard to manage some common configuration and dependencies. So tried to gather common dependecies like lombok, object mapper and mapstruct etc in common package. Also, I thought it made sense if I gathered their annotation processors.
But I had a issue maven install when done that. Programmatically, I had no issue and my services were up without any issue. But when I tried to mvn clean compile the service which depended on common dependency I created it couldn't find the some enum in common package and said that error:
not found in package message
To solve it, I needed to add lombok, mapstruct and their processors in each service which used them.
That s okay for me. I think the reason is the processors but i couldn't understand why i can't do that. I don't even know what i should research for this. Could you enlighten me about this?
And, that s my case with pom files:
one of common:
<dependencies>
<!-- some other dependencies without any issue -->
<dependency>
<groupId>.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${mapstruct.version}</version>
</dependency>
<dependency>
<groupId>.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
<path>
<groupId>.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
one of other services which use common:
<dependency>
<groupId>com.order.management</groupId>
<artifactId>common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
本文标签: mavenImporting lombok and its annotation processor from custom dependencyStack Overflow
版权声明:本文标题:maven - Importing lombok and its annotation processor from custom dependency - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743922221a2562301.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论