在 @Mapper 中使用多个参数时,@Context 参数似乎无法访问
public interface MyMapper {
@Mapping(target="target1", source="arg1.arg") //works
@Mapping(target="target2", source="arg2") //works
@Mapping(target="target3", source="arg2.arg") //works
@Mapping(target="target2", source="context.arg") //NOT WORKING
public MyTarget convert(Object arg1, Object arg2, @Context Object context);
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用并expression=""解决它,但我无法让它工作。
有什么建议么?
我看得出来我不是唯一一个有此愿望的人。 https://github.com/mapstruct/mapstruct/issues/1280
谢谢
https://docs.spring.io/spring-boot/docs/current/maven-plugin/usage.html
我有一个项目,有2个模块.
[Parent]
|-pom.xml
| [SpringBoot2App]
| |-pom.xml
| [test]
| |-pom.xml (start goal here!)
Run Code Online (Sandbox Code Playgroud)
我想在一个单独的项目中运行集成测试(maven failsafe插件),这是另一个模块.
在父模块的集成测试期间,是否可以配置spring boot maven插件来启动/停止子模块?
我尝试过这样的事情没有成功
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.SimpleServiceApplication</mainClass>
<classesDirectory>../SpringBoot2App/target/classes</classesDirectory>
<folders>
<param>../SpringBoot2App/target/test-classes</param>
</folders>
</configuration>
<executions>
<execution>
<goals>
<goal>start</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
哪个不起作用.
我还尝试在读取插件超级类的源代码后添加"project"参数 https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot -tools /弹簧引导Maven的插件/ src目录/主/ JAVA /组织/ springframework的的/ boot /行家/ AbstractRunMojo.java
<configuration>
<mainClass>com.SimpleServiceApplication</mainClass>
<project>${project.parent.collectedProjects[0]}</project>
</configuration>
Run Code Online (Sandbox Code Playgroud)
这指的是正确的项目,如调试所示,但也不起作用.
请不要评论[0],我知道[0]不干净,是一个需要直接了解父pom模块排序的耦合.
我在org/springframework/boot/SpringApplication上得到一个java.lang.NoClassDefFoundError
我将starter-web项目添加到测试pom.xml,结果相同
前一段时间我试图在ubuntu 12.04上在512m内存的EC2实例上安装artifactory 2.6.1.但是当我开始它时,在初始化之后它就完全退出了.我把它安装在带有3g内存的ubuntu 10上,它可以工作.
现在我在那个小实例上安装另一个Web应用程序,它运行正常.但是当我们的db加载了更多数据时,tomcat退出而没有跟踪.虽然它仍适用于更大的实例.
由于artifactory和我的web应用程序行为相同,我倾向于责怪tomcat.为什么tomcat会死而没有错误输出?它真的与记忆有关吗?
谢谢.