Can jboss-forge scan also jars in dependencies to check if they have appropriate classes?

108 views Asked by At

Hy all

I'm creating a project with jboss forge (2.20.2 Final), type war, that will be included in an ear. In this project I have a reference to a jar project with ejb, entities and persistence unit. This is included as a dependency in the pom of the war project This last is in .m2/repositories (local maven repository).

Working from command line of forge in the war project directory ( or also throgh script) , i want to use forge commands like jpa-generate-daos-from-entities or scaffold-generate , referring to the classes and resources of the other project.

Can forge scan also jars in dependencies to check if they have appropriate classes ?

Looks like it is not possible. Have you any idea?

EDIT

This is a sample command sequence and the messages :

[FORGE]$ project-new --named foo --topLevelPackage com.bar --type parent
[foo]$ project-new --named foo-web --topLevelPackage com.bar --type war
[foo-web]$ cd ..\
[foo]$ project-new --named foo-ejb --topLevelPackage com.bar --type jar
[foo-ejb]$ jpa-new-entity --named User --targetPackage com.bar.ejb
[User.java]$ jpa-new-field --named username
[User.java]$

[foo-web]$ scaffold-setup
[persistence.xml]$ scaffold-generate --targets com.bar.ejb.User

***ERROR*** Targets must be specified.

[foo-web]$ project-add-dependencies com.bar:foo-ejb:1.0.0-SNAPSHOT
[foo-web]$ scaffold-generate --targets com.bar.ejb.User
***ERROR*** Targets must be specified.
1

There are 1 answers

0
ariver On

you could execute scaffold-generate without --targets, then forge ask for the targets

something like this:

scaffold-generate

then forge:

[0] ( ) com.bar.ejb.User

Press to confirm, or +C to cancel. * Targets (The JPA entities to use as the basis for generating the scaffold.): [0]

type 0 and enter, then, the entity is selected

[0] (x) com.bar.ejb.User

Press to confirm, or +C to cancel. * Targets (The JPA entities to use as the basis for generating the scaffold.): [0]

Enter!