Apache Isis 构建失败指定未知存储库时使用 ApplicationUser 中的用户作为我实体的 属性

Apache Isis Build Fail specifies unknown repository when use User from ApplicationUser as property of my Entity

我希望我的员工有如下用户

import org.isisaddons.module.security.dom.role.ApplicationRole;
import org.isisaddons.module.security.dom.user.ApplicationUser;
import org.isisaddons.module.security.dom.user.ApplicationUserRepository;

@Column(allowsNull = "true")
@Property(editing = Editing.ENABLED)
@Getter @Setter
private ApplicationUser user;

public List<ApplicationUser> choicesUser() {
    return applicationUserRepository.allUsers();
}

public List<ApplicationRole> getUserRoles() {
    return user!=null? Lists.newArrayList(user.getRoles()):Lists.newArrayList();
}

@Action()
public Employee createUser(
        @ParameterLayout(named = "Username") final String username,
        @ParameterLayout(named = "Password") final Password password,
        @ParameterLayout(named = "Repeat Password") final Password repeatPassword,
        final ApplicationRole initialRole,
        final Boolean enable,
        final String emailAddress) {
    ApplicationUser applicationUser = applicationUserRepository.newLocalUser(username, password, repeatPassword, initialRole, enable, emailAddress);
    this.setUser(applicationUser);
    return this;
}

当我在 IDE 上 运行 它 运行 正常,一切都按预期工作,但后来我 运行 mvn clean install,它出现如下错误,当我删除上面的代码时,它构建得很好。还有什么我错过的吗?

[INFO] calling @PostConstruct on all domain services
[WARNING] NOT configured
[ERROR]
[ERROR]
[ERROR]
[ERROR] @DomainObject annotation on org.isisaddons.module.security.dom.role.ApplicationRole specifies unknown repository 'org.isisaddons.module.security.dom.role.ApplicationRoleRepository'
[ERROR] @DomainObject annotation on org.isisaddons.module.security.dom.user.ApplicationUser specifies unknown repository 'org.isisaddons.module.security.dom.user.ApplicationUserRepository'
[ERROR]
[ERROR]
[ERROR]
[INFO] calling @PreDestroy on all domain services
[INFO] shutting down org.apache.isis.core.metamodel.specloader.SpecificationLoader@1f041bad
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Incode QuickStart .................................. SUCCESS [  0.279 s]
[INFO] Incode QuickStart Base Module ...................... SUCCESS [  2.480 s]
[INFO] Employment Module .................................. FAILURE [ 11.695 s]
[INFO] Incode QuickStart App Definition ................... SKIPPED
[INFO] Incode QuickStart Webapp ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.022 s
[INFO] Finished at: 2017-11-06T11:09:35+07:00
[INFO] Final Memory: 59M/457M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.15.1:validate (default) on project pApp-module-employment: 2 meta-model problems found. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :pApp-module-employment

请帮助,我也通过关注另一个具有类似问题的问题来删除 pom 上的 !,但它不起作用!!!

simpleapp 原型预先配置为 运行 Apache Isis maven 插件的 "validate" 目标,它检查域逻辑中的语义错误(例如孤立的支持方法)。您的堆栈显示了另一个错误:引用不存在的存储库的实体。

来自 AppManifest 的 Maven 插件 运行s - 模块简单模块的 pom.xml 中的详细信息 - 但这与用于 bootstrap 的 AppManifest 不同应用:仅针对单个模块。

由于您的 Employee 实体正在引用 ApplicationUser,这导致 ApplicationUser 成为元模型的一部分,因此得到验证。 我的猜测是 Maven 插件使用的 AppManifest 没有引用安全模块(具有所需的存储库),这会触发错误。

修复只是将安全模块的声明添加到此 AppManifest 中。您可能只需将您使用的 AppManifest 中的相关行复制到 bootstrap 应用程序。

HTH