jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

No plugin found for prefix 'liquibase' in the current project #18498

Closed leottamichel closed 9 months ago

leottamichel commented 2 years ago
Overview of the issue

When I try to run man liquidate:diff an error occur and it says that no plugin found for prefix 'liquibase' No plugin found for prefix 'liquibase' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/michel/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

Motivation for or Use Case

the function has worked for a long time and recently this error appears.

Reproduce the error

maven pom not changed

JHipster Version(s)

7.6.0

JHipster configuration

INFO! Using JHipster version installed globally Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
swaps@0.0.1-SNAPSHOT /Users/michel/swaps
└── generator-jhipster@7.6.0
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationIndex": 0,
    "applicationType": "gateway",
    "authenticationType": "jwt",
    "baseName": "swaps",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1645196418357,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": [
      "PlanedPrio",
      "Project",
      "StakeholderInProject",
      "StakeholderHistory",
      "CustomerNeed",
      "AsyncPrio",
      "CustomerNeedPrioInSession",
      "PriorizationSession",
      "CustomerNeedHistory",
      "CustomerNeed6W",
      "Story",
      "CustomerNeedCorrelation",
      "StoryRelation",
      "Roles",
      "StoryHistory",
      "Feedback"
    ],
    "entitySuffix": "",
    "gradleEnterpriseHost": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.6.0",
    "jwtSecretKey": "-",
    "languages": ["en"],
    "lastLiquibaseTimestamp": 1645197378000,
    "messageBroker": false,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageFolder": "com/swaps/gateway",
    "packageName": "com.swaps.gateway",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": true,
    "searchEngine": false,
    "serverPort": "8080",
    "serviceDiscoveryType": "eureka",
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": false,
    "testFrameworks": ["protractor"],
    "websocket": false,
    "withAdminUi": true
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity PlanedPrio {
  comment String
}
entity Project {
  name String
  description String
  budget Integer
  endDate ZonedDateTime
  projectStart ZonedDateTime
  sprint Integer
  weekday Weekday
}
entity StakeholderInProject {
  active Boolean
  role StakeholderRole
  prio Long
}
entity StakeholderHistory {
  comment String
  updatedAt ZonedDateTime
}
entity CustomerNeed {
  active Boolean
  name String
  description String
  prioFine Long
  prioMiddle Long
  prioRough PrioRough
}
entity AsyncPrio {
  createdAt ZonedDateTime
  prioRough PrioRough
  prioMiddle Long
  prioFine Long
}
entity CustomerNeedPrioInSession
entity PriorizationSession {
  active Boolean
  createdAt ZonedDateTime
  mode Session
  step SessionMode
  deadline ZonedDateTime
  time ZonedDateTime
  name String
}
entity CustomerNeedHistory {
  comment String
  updatedAt ZonedDateTime
}
entity CustomerNeed6W {
  how String
  when String
  whereAbout String
  where String
  who String
  why String
}
entity Story {
  name String
  active Boolean
  prioValue Long
  role String
}
entity CustomerNeedCorrelation {
  weight Correlation
}
entity StoryRelation
entity Roles {
  name String
}
entity StoryHistory {
  comment String
  updatedAt ZonedDateTime
}
entity Feedback {
  comment String
  updatedAt ZonedDateTime
  impression Integer
  scope Integer
  userGuidance Integer
}
enum Weekday {
  MONDAY,
  TUESDAY,
  WEDNESDAY,
  THURSDAY,
  FRIDAY,
  SATURDAY,
  SUNDAY
}
enum StakeholderRole {
  PO,
  DEVELOPER,
  SCRUMMASTER,
  CLIENT,
  BUSINESS,
  ANALYST,
  DESIGNER,
  PRODUCT,
  MANAGER
}
enum PrioRough {
  CRITICAL,
  STANDARD,
  OPTIONAL
}
enum Session {
  SYNCHRONOUS,
  ASYNCHRONOUS
}
enum SessionMode {
  FINE,
  MIDDLE,
  ROUGH
}
enum Correlation {
  HIGH,
  MIDDLE,
  LOW
}

relationship ManyToOne {
  PlanedPrio{stakeholder} to User
  PlanedPrio{prioritization} to PriorizationSession
  Project{owner} to User
  StakeholderInProject{stakeholder} to User
  StakeholderInProject{project} to Project
  StakeholderHistory{updatedBy} to User
  StakeholderHistory{roleUpdated} to StakeholderInProject
  StakeholderHistory{project} to Project
  CustomerNeed{createdBy} to User
  CustomerNeed{project} to Project
  AsyncPrio{executedBy} to User
  CustomerNeedPrioInSession{prioritization} to PriorizationSession
  CustomerNeedPrioInSession{customerNeed} to CustomerNeed
  PriorizationSession{project} to Project
  CustomerNeedHistory{updatedBy} to User
  CustomerNeedHistory{customerNeed} to CustomerNeed
  CustomerNeed6W{customerNeed} to CustomerNeed
  Story{roles} to Roles
  Story{project} to Project
  CustomerNeedCorrelation{customerNeed} to CustomerNeed
  CustomerNeedCorrelation{story} to Story
  StoryRelation{story} to Story
  StoryRelation{storyBefore} to Story
  StoryHistory{updatedBy} to User
  StoryHistory{project} to Project
  StoryHistory{story} to Story
}
relationship ManyToMany {
  AsyncPrio{customerNeed} to CustomerNeed{prioValueAsync}
}

Environment and Tools

openjdk version "11.0.14.1" 2022-02-08 OpenJDK Runtime Environment Homebrew (build 11.0.14.1+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.14.1+0, mixed mode)

git version 2.35.1

node: v16.14.2

npm: 8.5.0

Docker version 20.10.14, build a224086

Docker Compose version v2.4.1

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
mraible commented 2 years ago

I tried creating a new project with JHipster 7.8.1 using your .yo-rc.json. This works. However, when I tried to import your JDL with jhipster jdl entities.jdl, it fails with the following error:

   create src/main/java/com/swaps/gateway/web/rest/PlanedPrioResource.java
   create src/main/java/com/swaps/gateway/repository/PlanedPrioRepository.java
Error running generator entities: Error: Error parsing file src/main/java/com/swaps/gateway/repository/PlanedPrioRepositoryInternalImpl.java: undefined

At: 1: package com.swaps.gateway.repository;
2:
3: import java.util.function.BiFunction;
4: import java.util.ArrayList;
5: import java.util.List;
6: import java.util.Map;
7: import java.util.Map.Entry;
8: import java.util.Optional;
9: import org.springframework.data.domain.Pageable;
10: import io.r2dbc.spi.Row;
11: import io.r2dbc.spi.RowMetadata;
12: import static org.springframework.data.relational.core.query.Criteria.where;
13: import org.springframework.data.r2dbc.convert.R2dbcConverter;
14: import org.springframework.data.r2dbc.core.R2dbcEntityOperations;
15: import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
16: import org.springframework.data.r2dbc.repository.support.SimpleR2dbcRepository;
17: import org.springframework.data.relational.core.query.Criteria;
18: import org.springframework.data.relational.core.sql.Column;
19: import org.springframework.data.relational.core.sql.Comparison;
20: import org.springframework.data.relational.core.sql.Condition;
21: import org.springframework.data.relational.core.sql.Conditions;
22: import org.springframework.data.relational.core.sql.Expression;
23: import org.springframework.data.relational.core.sql.Select;
24: import org.springframework.data.relational.core.sql.SelectBuilder.SelectFromAndJoinCondition;
25: import org.springframework.data.relational.core.sql.Table;
26: import org.springframework.data.relational.repository.support.MappingRelationalEntityInformation;
27: import org.springframework.r2dbc.core.DatabaseClient;
28: import org.springframework.r2dbc.core.RowsFetchSpec;
29:
30: import com.swaps.gateway.domain.PlanedPrio;
31:
32: import .repository.rowmapper.UserRowMapper;
33: import com.swaps.gateway.repository.rowmapper.PriorizationSessionRowMapper;
34: import com.swaps.gateway.repository.rowmapper.PlanedPrioRowMapper;
35:
36: import reactor.core.publisher.Flux;
37: import reactor.core.publisher.Mono;
38:
39: /**
40:  * Spring Data SQL reactive custom repository implementation for the PlanedPrio entity.
41:  */
42: @SuppressWarnings("unused")
43: class PlanedPrioRepositoryInternalImpl extends SimpleR2dbcRepository<PlanedPrio, Long> implements PlanedPrioRepositoryInternal {
44:     private final DatabaseClient db;
45:     private final R2dbcEntityTemplate r2dbcEntityTemplate;
46:     private final EntityManager entityManager;
47:
48:     private final UserRowMapper userMapper;
49:     private final PriorizationSessionRowMapper priorizationsessionMapper;
50:     private final PlanedPrioRowMapper planedprioMapper;
51:
52:     private final static Table entityTable = Table.aliased("planed_prio", EntityManager.ENTITY_ALIAS);
53:     private final static Table stakeholderTable = Table.aliased("jhi_user", "stakeholder");
54:     private final static Table prioritizationTable = Table.aliased("priorization_session", "prioritization");
55:
56:
57:     public PlanedPrioRepositoryInternalImpl(R2dbcEntityTemplate template, EntityManager entityManager, UserRowMapper userMapper, PriorizationSessionRowMapper priorizationsessionMapper, PlanedPrioRowMapper planedprioMapper, R2dbcEntityOperations entityOperations,
58:         R2dbcConverter converter) {
59:         super(new MappingRelationalEntityInformation(converter.getMappingContext().getRequiredPersistentEntity(PlanedPrio.class)), entityOperations, converter);
60:         this.db = template.getDatabaseClient();
61:         this.r2dbcEntityTemplate = template;
62:         this.entityManager = entityManager;
63:         this.userMapper = userMapper;
64:         this.priorizationsessionMapper = priorizationsessionMapper;
65:         this.planedprioMapper = planedprioMapper;
66:     }
67:
68:     @Override
69:     public Flux<PlanedPrio> findAllBy(Pageable pageable) {
70:         return createQuery(pageable, null).all();
71:     }
72:
73:     RowsFetchSpec<PlanedPrio> createQuery(Pageable pageable, Condition whereClause) {
74:         List<Expression> columns = PlanedPrioSqlHelper.getColumns(entityTable, EntityManager.ENTITY_ALIAS);
75:         columns.addAll(UserSqlHelper.getColumns(stakeholderTable, "stakeholder"));
76:         columns.addAll(PriorizationSessionSqlHelper.getColumns(prioritizationTable, "prioritization"));
77:         SelectFromAndJoinCondition selectFrom = Select.builder().select(columns).from(entityTable)
78:             .leftOuterJoin(stakeholderTable).on(Column.create("stakeholder_id", entityTable)).equals(Column.create("id", stakeholderTable ))
79:             .leftOuterJoin(prioritizationTable).on(Column.create("prioritization_id", entityTable)).equals(Column.create("id", prioritizationTable ))
80: ;
81:         // we do not support Criteria here for now as of https://github.com/jhipster/generator-jhipster/issues/18269
82:         String select = entityManager.createSelect(selectFrom, PlanedPrio.class, pageable, whereClause);
83:         return db.sql(select).map(this::process);
84:     }
85:
86:     @Override
87:     public Flux<PlanedPrio> findAll() {
88:         return findAllBy(null);
89:     }
90:
91:     @Override
92:     public Mono<PlanedPrio> findById(Long id) {
93:         Comparison whereClause = Conditions.isEqual(entityTable.column("id"), Conditions.just(id.toString()));
94:         return createQuery(null, whereClause).one();
95:     }
96:
97:     private PlanedPrio process(Row row, RowMetadata metadata) {
98:         PlanedPrio entity = planedprioMapper.apply(row, "e");
99:         entity.setStakeholder(userMapper.apply(row, "stakeholder"));
100:         entity.setPrioritization(priorizationsessionMapper.apply(row, "prioritization"));
101:         return entity;
102:     }
103:
104:     @Override
105:     public <S extends PlanedPrio> Mono<S> save(S entity) {
106:         return super.save(entity);
107:     }
108:
109: }
110:
Error: Error parsing file src/main/java/com/swaps/gateway/repository/PlanedPrioRepositoryInternalImpl.java: undefined

At: 1: package com.swaps.gateway.repository;
2:
3: import java.util.function.BiFunction;
4: import java.util.ArrayList;
5: import java.util.List;
6: import java.util.Map;
7: import java.util.Map.Entry;
8: import java.util.Optional;
9: import org.springframework.data.domain.Pageable;
10: import io.r2dbc.spi.Row;
11: import io.r2dbc.spi.RowMetadata;
12: import static org.springframework.data.relational.core.query.Criteria.where;
13: import org.springframework.data.r2dbc.convert.R2dbcConverter;
14: import org.springframework.data.r2dbc.core.R2dbcEntityOperations;
15: import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
16: import org.springframework.data.r2dbc.repository.support.SimpleR2dbcRepository;
17: import org.springframework.data.relational.core.query.Criteria;
18: import org.springframework.data.relational.core.sql.Column;
19: import org.springframework.data.relational.core.sql.Comparison;
20: import org.springframework.data.relational.core.sql.Condition;
21: import org.springframework.data.relational.core.sql.Conditions;
22: import org.springframework.data.relational.core.sql.Expression;
23: import org.springframework.data.relational.core.sql.Select;
24: import org.springframework.data.relational.core.sql.SelectBuilder.SelectFromAndJoinCondition;
25: import org.springframework.data.relational.core.sql.Table;
26: import org.springframework.data.relational.repository.support.MappingRelationalEntityInformation;
27: import org.springframework.r2dbc.core.DatabaseClient;
28: import org.springframework.r2dbc.core.RowsFetchSpec;
29:
30: import com.swaps.gateway.domain.PlanedPrio;
31:
32: import .repository.rowmapper.UserRowMapper;
33: import com.swaps.gateway.repository.rowmapper.PriorizationSessionRowMapper;
34: import com.swaps.gateway.repository.rowmapper.PlanedPrioRowMapper;
35:
36: import reactor.core.publisher.Flux;
37: import reactor.core.publisher.Mono;
38:
39: /**
40:  * Spring Data SQL reactive custom repository implementation for the PlanedPrio entity.
41:  */
42: @SuppressWarnings("unused")
43: class PlanedPrioRepositoryInternalImpl extends SimpleR2dbcRepository<PlanedPrio, Long> implements PlanedPrioRepositoryInternal {
44:     private final DatabaseClient db;
45:     private final R2dbcEntityTemplate r2dbcEntityTemplate;
46:     private final EntityManager entityManager;
47:
48:     private final UserRowMapper userMapper;
49:     private final PriorizationSessionRowMapper priorizationsessionMapper;
50:     private final PlanedPrioRowMapper planedprioMapper;
51:
52:     private final static Table entityTable = Table.aliased("planed_prio", EntityManager.ENTITY_ALIAS);
53:     private final static Table stakeholderTable = Table.aliased("jhi_user", "stakeholder");
54:     private final static Table prioritizationTable = Table.aliased("priorization_session", "prioritization");
55:
56:
57:     public PlanedPrioRepositoryInternalImpl(R2dbcEntityTemplate template, EntityManager entityManager, UserRowMapper userMapper, PriorizationSessionRowMapper priorizationsessionMapper, PlanedPrioRowMapper planedprioMapper, R2dbcEntityOperations entityOperations,
58:         R2dbcConverter converter) {
59:         super(new MappingRelationalEntityInformation(converter.getMappingContext().getRequiredPersistentEntity(PlanedPrio.class)), entityOperations, converter);
60:         this.db = template.getDatabaseClient();
61:         this.r2dbcEntityTemplate = template;
62:         this.entityManager = entityManager;
63:         this.userMapper = userMapper;
64:         this.priorizationsessionMapper = priorizationsessionMapper;
65:         this.planedprioMapper = planedprioMapper;
66:     }
67:
68:     @Override
69:     public Flux<PlanedPrio> findAllBy(Pageable pageable) {
70:         return createQuery(pageable, null).all();
71:     }
72:
73:     RowsFetchSpec<PlanedPrio> createQuery(Pageable pageable, Condition whereClause) {
74:         List<Expression> columns = PlanedPrioSqlHelper.getColumns(entityTable, EntityManager.ENTITY_ALIAS);
75:         columns.addAll(UserSqlHelper.getColumns(stakeholderTable, "stakeholder"));
76:         columns.addAll(PriorizationSessionSqlHelper.getColumns(prioritizationTable, "prioritization"));
77:         SelectFromAndJoinCondition selectFrom = Select.builder().select(columns).from(entityTable)
78:             .leftOuterJoin(stakeholderTable).on(Column.create("stakeholder_id", entityTable)).equals(Column.create("id", stakeholderTable ))
79:             .leftOuterJoin(prioritizationTable).on(Column.create("prioritization_id", entityTable)).equals(Column.create("id", prioritizationTable ))
80: ;
81:         // we do not support Criteria here for now as of https://github.com/jhipster/generator-jhipster/issues/18269
82:         String select = entityManager.createSelect(selectFrom, PlanedPrio.class, pageable, whereClause);
83:         return db.sql(select).map(this::process);
84:     }
85:
86:     @Override
87:     public Flux<PlanedPrio> findAll() {
88:         return findAllBy(null);
89:     }
90:
91:     @Override
92:     public Mono<PlanedPrio> findById(Long id) {
93:         Comparison whereClause = Conditions.isEqual(entityTable.column("id"), Conditions.just(id.toString()));
94:         return createQuery(null, whereClause).one();
95:     }
96:
97:     private PlanedPrio process(Row row, RowMetadata metadata) {
98:         PlanedPrio entity = planedprioMapper.apply(row, "e");
99:         entity.setStakeholder(userMapper.apply(row, "stakeholder"));
100:         entity.setPrioritization(priorizationsessionMapper.apply(row, "prioritization"));
101:         return entity;
102:     }
103:
104:     @Override
105:     public <S extends PlanedPrio> Mono<S> save(S entity) {
106:         return super.save(entity);
107:     }
108:
109: }
110:
    at patternSpy.dot (/Users/mraible/Downloads/18498/node_modules/generator-jhipster/generators/generator-transforms.js:79:15)
    at async PTransform.transform [as _transform] (/Users/mraible/Downloads/18498/node_modules/p-transform/index.js:127:7)
    at async PTransform.queuedTransform (/Users/mraible/Downloads/18498/node_modules/p-transform/index.js:88:26)
    at async run (/Users/mraible/Downloads/18498/node_modules/p-queue/dist/index.js:163:29)
ERROR! Error parsing file src/main/java/com/swaps/gateway/repository/PlanedPrioRepositoryInternalImpl.java: undefined
mraible commented 2 years ago

As for liquibase, using the fully-qualified name seems to work:

https://stackoverflow.com/a/58542369/65681

mvn org.liquibase:liquibase-maven-plugin:diff

I don't see the liquibase plugin defined in pom.xml. I thought this might be because your app is reactive, so I tried re-generating with reactive: false. It's still not there with non-reactive apps.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days