2

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

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,但它不起作用!

4

1 回答 1

2

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

maven 插件从 AppManifest 运行 - 模块简单模块的 pom.xml 中的详细信息 - 但这与用于引导应用程序的 AppManifest 不同:它仅适用于单个模块。

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

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

高温高压

于 2017-11-07T22:34:45.057 回答