yes!!
that did the trick \o/.
thanks for your time and help.
Ok, I found one issue - and was able to get things working locally.
In your POM.xml, you have the forge-shell-api listed twice, once as provided scope (correct) and once as compile scope (incorrect.) You should remove the second dependency on forge-shell-api.
You should also remove the shrinkwrap descriptors depenency, since that is provided by forge as well.
Does that get you up and running on SNAPSHOT?
~Lincoln
[ConventionsLayers] ConventionsLayers $ forge source-plugin .
***INFO*** Invoking build with underlying build system.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.jsf.conventions.layers:ConventionsLayers:jar:1.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 45, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 52, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ConventionsLayers 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ ConventionsLayers ---
[INFO] Deleting /home/lb3/Desktop/ConventionsLayers/target
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ ConventionsLayers ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ ConventionsLayers ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 3 source files to /home/lb3/Desktop/ConventionsLayers/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ ConventionsLayers ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ ConventionsLayers ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ ConventionsLayers ---
[INFO] Surefire report directory: /home/lb3/Desktop/ConventionsLayers/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ ConventionsLayers ---
[INFO] Building jar: /home/lb3/Desktop/ConventionsLayers/target/ConventionsLayers-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.216s
[INFO] Finished at: Tue Oct 25 16:30:29 EDT 2011
[INFO] Final Memory: 12M/162M
[INFO] ------------------------------------------------------------------------
***SUCCESS*** Build successful.
***INFO*** Installing plugin artifact.
Warning: The encoding 'UTF-8' is not supported by the Java runtime.
Warning: The encoding 'UTF-8' is not supported by the Java runtime.
Warning: The encoding 'UTF-8' is not supported by the Java runtime.
***SUCCESS*** Installed from [ConventionsLayers] successfully.
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb/ConventionsLayers.jar
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb/module.xml
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/dependencies/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/dependencies/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb/velocity-1.7.jar
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/dependencies/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb/commons-collections-3.2.1.jar
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/dependencies/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb/commons-lang-2.4.jar
Wrote /home/lb3/.forge/plugins/com/jsf/conventions/layers/ConventionsLayers/dependencies/1.0.0-SNAPSHOT-e41431fd-4f59-4d09-94b0-f0deb920ccbb/module.xml
[ConventionsLayers] ConventionsLayers $
[ConventionsLayers] ConventionsLayers $
[ConventionsLayers] ConventionsLayers $
[ConventionsLayers] ConventionsLayers $
[ConventionsLayers] ConventionsLayers $ layers generate-controller --class com.jsf.conventions.layers.
model. LayersPlugin.java
[ConventionsLayers] ConventionsLayers $ layers generate-controller --class com.jsf.conventions.layers.
model. LayersPlugin.java
[ConventionsLayers] ConventionsLayers $ layers generate-controller --class com.jsf.conventions.layers.model.Person.java
Project:ProjectImpl [ConventionsLayers]
Choose bean scope
1 - [RequestScoped]
2 - [ViewAccessScoped]*
3 - [ConversationScoped]
4 - [SessionScoped]
? Choose an option by typing the number of the selection [*-default] [0]
<<< Managed bean personMBean created sucessfuly. >>>
Wrote /home/lb3/Desktop/ConventionsLayers/src/main/java/com/jsf/conventions/layers/controller/personMBean.java
[ConventionsLayers] ConventionsLayers $
On Tue, Oct 25, 2011 at 4:26 PM, Lincoln Baxter, III <lincolnbaxter@gmail.com> wrote:
Thanks. I'll take a look at this ASAP.On Tue, Oct 25, 2011 at 8:52 AM, Rafael Pestano <rmpestano@gmail.com> wrote:
sure, im attaching it to this mail. I also will try to reproduce the error here at company.2011/10/25 Lincoln Baxter, III <lincolnbaxter@gmail.com>
Is it possible for you to share your project sourcecode? That would help figure this out. Also, if you could post your pom.xml, because it looks like some things are getting pulled in that shouldn't be.
Thanks,
LincolnOn Mon, Oct 24, 2011 at 8:07 PM, Rafael Pestano <rmpestano@gmail.com> wrote:
Hi there,
I still dont know why it works with alpha4, ive downloaded todays snapshot and same error, the execution image is here;
alpha4 execution
snapshot execution
im just switching the FORGE_HOME enviroment variable, generating the plugin and executing the command.
Im attaching both prompt output in this email, maybe it helps.2011/10/24 Lincoln Baxter, III <lincolnbaxter@gmail.com>
Good! Glad you got it working.
I'm concerned that you are using an outdated version of Forge, however. It still does not work for you on Beta3 or latest SNAPSHOT versions?
I'd like to figure out why :)
Thanks!
~LincolnOn Sun, Oct 23, 2011 at 6:31 PM, Rafael Pestano <rmpestano@gmail.com> wrote:
Now it's working!!!!! \o/
Ive downloaded the alpha4(tried SNAPSHOT, Betas 2 and 3 without success) release and just changed the FORGE_HOME to point to it and solved the injection problem.
I also had to add
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-api</artifactId>
<version>0.1.7</version>
</dependency>
in order to use forge-shell-api 1.0.0-SNAPSHOT.
And finaly added commons-lang-2.4.jar, commons-collections-3.1 to forge_home/lib
and now i can see "Wrote /JAVA/Projetos/Conventions/Conventions/ConventionsLayers/src/main/java/com/jsf/conventions/layers/controller/Per
nMBean.java" after my command execution
many thanks for your help, keep the great work!2011/10/23 Lincoln Baxter, III <lincolnbaxter@gmail.com>
Why are you importing @RequestScoped?
It's possible that is breaking something, though I don't see why it would. It looks like something else is happening in code that you did not show. Your plugin does not need to be @Scoped.
If this still occurs, try injecting Event<PickupResources> event; instead of injecting the BeanManager, though I don't see why that would make a difference either ;)
Hope this helps,
LincolnLincoln Baxter, III
On Sun, Oct 23, 2011 at 4:15 PM, Rafael Pestano <rmpestano@gmail.com> wrote:Hi Lincon,
yes i got a look at scaffolding plugins project source but for now im getting used to forge so the ideia is create some plugins to see how stuff works, but thanks for pointing that.
At the moment im trying to understand how resource injection is done in Forge cause i cant inject anything in my plugin.
Ive tried to make my plugin a CDI bean but when i execute the command i got " WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped"
here is my plugin(same as arquillian plugin Paul has pointed out but with different velocity templete): http://pastebin.com/nrc3PTz2
and my pom.xml: http://pastebin.com/etcQYNt42011/10/23 Lincoln Baxter, III <lincolnbaxter@gmail.com>
Hi Rafael!
What you want to do sounds really interesting! Have you taken a look at the forge-scaffold-api? Its located as a sub-folder of the github repository that you just cloned.
This will let you use the 'scaffold from-entity' command to invoke your code, and it will also let people use the familiar api. We can also make some improvements to that api if you need it :)
--
Lincoln Baxter's Droid
http://ocpsoft.com
"Keep it Simple"On Oct 23, 2011 10:03 AM, "Rafael Pestano" <rmpestano@gmail.com> wrote:I was meaning just clone it ;)
Nice to hear about the scaffolding plugin.2011/10/23 Paul Bakker <paul.bakker.nl@gmail.com>
Hi Rafael,What do you mean by clone and forge the project? On github you can just clone the plugin-arquillian project and start hacking on it.Formatting is a bit of a problem, that doesn't work very well now with the builder API. Maybe Lincoln can say more about that?Note that within a few weeks Forge will have a new scaffolding plugin built-in, that does basically something that you are doing in your plugin.PaulOn Oct 23, 2011, at 3:45 PM, Rafael Pestano wrote:I've managed to clone forge repo with this address https://github.com/forge/core.git now, i was using the old github.com/seam/forge.git.
2011/10/23 Rafael Pestano <rmpestano@gmail.com>
Hello Paul, thanks for your enlightening reply.
The plugin is about a code generator for a home made Java EE6 framework and for instance it will generate very simple xhtml and java classes, so for example the generate-controller plugin would generate
@ViewAccessScoped
@Named("personMBean")
public class PersonMBean extends AbstractBaseMBean<Person> implements Serializable, ModalObserver {
@Inject
public void setPersonService(PersonService personService) {//service layer will be generated togheter
super.setBaseService(personService);
}
some other very simple methods
}
for the controller-plugin maybe i dont need to understand the model class (just to import it) cause its just a matter of replacing parammeters by the domain object but in the view-plugin it will be necessary for sure.
Another concern i have is how to format the generated code? maybe the velocity template could help on that.
Ive seen the Arquillian example, how can i clone it and forge project?
Thanks again!
2011/10/23 Paul Bakker <paul.bakker.nl@gmail.com>
Hi Rafael,There are two things you need to do:1) "understand" the Person class2) generate new code1)You can use a command parameter to get the Person class: @Option(name = "class", required = true, type = PromptType.JAVA_CLASS) JavaResource classUnderTestJavaResource is a rich file representation of the class.Now you can use the JavaSourceFacet to get information about the class itself:JavaSourceFacet java = project.getFacet(JavaSourceFacet.class);JavaSource<?> javaSource = classUnderTest.getJavaSource();javaSource has methods such as getPackage() etc.2)Now you have to generate code. There are two ways to do this, depending on your needs.The most elegant way is to use the "JavaParser" builder API:JavaClass javaClass = JavaParser.create(JavaClass.class).setPackage(entityPackage).setName(entityName).setPublic().addAnnotation(Entity.class).getOrigin().addInterface(Serializable.class);Field<JavaClass> id = javaClass.addField("private Long id = null;");….My experience is that this works best for small classes. If you need to generate a lot of code it might be better to use a tempting framework such as Apache Velocity.You can find an example of this in the code of the Arquillian plugin: https://github.com/forge/plugin-arquillian/blob/master/src/main/java/org/jboss/seam/forge/arquillian/ArquillianPlugin.java#L93You can just add Velocity to your pom file and it will work.If you have any more questions, let us know! What kind of plugin are you writing?Paul BakkerOn Oct 23, 2011, at 2:26 AM, Rafael Pestano wrote:_______________________________________________Hi everyone,
this is my first mail to this list and id like to congratulate the Forge team for their work.
my question is, what's the best way to generate .java, .xhtml files with forge?
Id like to write a plugin which would receive an entity class as parameter and generate some code on top of it, eg:$ generate-service Person
$ generate-controller Person
$
generate-view
Person
Where Person is a domain object, is it possible with Forge? if yes, whats the best way?
thanks in advance.
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Att,
Rafael M. Pestano
Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
Graduando em Ciência da Computação UFRGS
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev