[JBoss JIRA] (FORGE-1432) run command is missing (and with it, scripting)
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1432?page=com.atlassian.jira.plugin... ]
Antonio Goncalves commented on FORGE-1432:
------------------------------------------
How does this work ? I have a timeout.
I've created a simple file with a few command lines :
{code}
echo before export
export ACCEPT_DEFAULTS=true
echo before project-new
project-new --named testrun --topLevelPackage com.testrun --type war --finalName testrun
echo script end
{code}
When I run the file, I have the following output :
{code}
[Forge]$ run proj.fsh
[Forge]$ echo before export
before export
[Forge]$ ***ERROR*** proj.fsh: timed out.
[Forge]$
{code}
> run command is missing (and with it, scripting)
> -----------------------------------------------
>
> Key: FORGE-1432
> URL: https://issues.jboss.org/browse/FORGE-1432
> Project: Forge
> Issue Type: Sub-task
> Components: UI - Shell
> Affects Versions: 2.0.0.CR2
> Reporter: Antonio Goncalves
> Assignee: Lincoln Baxter III
> Fix For: 2.1.0.Final
>
>
> I use a lot of scripts to start my projects, add/remove Maven dependencies.... So when I'm in Forge console, I type {{run ../myScript.fsh}}. For example, here is a script I use to get ride of EE 6 dependencies and add EE7 :
> {code}
> @/* ====================================== */;
> @/* == From Java EE 6 to 7 Dependencies == */;
> @/* ====================================== */;
> project remove-dependency org.hibernate.javax.persistence:hibernate-jpa-2.0-api ;
> project remove-dependency javax.validation:validation-api ;
> project remove-dependency org.hibernate:hibernate-validator ;
> project remove-dependency javax.enterprise:cdi-api ;
> project remove-dependency org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec ;
> project remove-dependency org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec ;
> project remove-dependency org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec ;
> project remove-dependency org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec ;
> project remove-dependency org.jboss.spec.javax.faces:jboss-jsf-api_2.1_spec ;
> project remove-dependency org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec ;
> project add-dependency javax:javaee-api:7.0:provided ;
> project add-dependency org.primefaces:primefaces:4.0 ;
> project add-repository primefaces-repo http://repository.primefaces.org ;
> {code}
> I have other scripts like that. The good this is, without leaving the console, I can write :
> {code}
> [Forge]$ run script1.fsh
> [Forge]$ run script2.fsh
> [Forge]$ run script3.fsh
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (FORGE-1623) Could not register resource monitor with track-changes
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1623:
----------------------------------------
Summary: Could not register resource monitor with track-changes
Key: FORGE-1623
URL: https://issues.jboss.org/browse/FORGE-1623
Project: Forge
Issue Type: Bug
Components: UI - Shell
Affects Versions: 2.1.1.Final
Reporter: Antonio Goncalves
Priority: Critical
Creating a project with {{track-changes}} creates an exception :
{code}
[Forge]$ project-new --named test1
***SUCCESS*** Project named 'test1' has been created.
[test1]$ track-changes
***SUCCESS*** Resource change tracking is ON.
[test1]$ cd ..
[Forge]$ project-new --named test2
***ERROR*** Could not register resource monitor
[Forge]$
{code}
The exception is the following :
{code}
19:06:33,624 SEVERE [org.jboss.forge.addon.shell.aesh.CommandAdapter] (AeshProcess: 1) Failed to execute [project-new] due to exception.: java.lang.IllegalStateException: Could not register resource monitor
at org.jboss.forge.addon.resource.monitor.FileMonitor.registerMonitor(FileMonitor.java:90) [resources-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.resource.ResourceFactoryImpl.monitor(ResourceFactoryImpl.java:100) [resources-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.resource.ResourceFactoryImpl.monitor(ResourceFactoryImpl.java:86) [resources-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.resource.AbstractFileResource.monitor(AbstractFileResource.java:363) [resources-api-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.projects.impl.ProjectFactoryImpl.cacheProject(ProjectFactoryImpl.java:404)
at org.jboss.forge.addon.projects.impl.ProjectFactoryImpl.createProject(ProjectFactoryImpl.java:316)
at org.jboss.forge.addon.projects.ui.NewProjectWizard.execute(NewProjectWizard.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:59) [furnace-proxy-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34) [furnace-api-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:75) [furnace-proxy-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.projects.ui.NewProjectWizard_$$_javassist_1bff18e1-ed11-48bb-8b1e-3a451b01843a.execute(NewProjectWizard_$$_javassist_1bff18e1-ed11-48bb-8b1e-3a451b01843a.java)
at org.jboss.forge.addon.ui.impl.controller.WizardCommandControllerImpl.execute(WizardCommandControllerImpl.java:153) [ui-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.ui.impl.controller.NoUIWizardControllerDecorator.execute(NoUIWizardControllerDecorator.java:152) [ui-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:69) [shell-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:292) [aesh-0.49.jar:0.49]
at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:36) [aesh-0.49.jar:0.49]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: java.nio.file.NoSuchFileException: /Users/antoniombp/Documents/Code/temp/Forge/test2
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) [rt.jar:1.7.0_45]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) [rt.jar:1.7.0_45]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) [rt.jar:1.7.0_45]
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55) [rt.jar:1.7.0_45]
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144) [rt.jar:1.7.0_45]
at java.nio.file.Files.readAttributes(Files.java:1684) [rt.jar:1.7.0_45]
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:105) [rt.jar:1.7.0_45]
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69) [rt.jar:1.7.0_45]
at java.nio.file.Files.walkFileTree(Files.java:2600) [rt.jar:1.7.0_45]
at java.nio.file.Files.walkFileTree(Files.java:2633) [rt.jar:1.7.0_45]
at org.jboss.forge.addon.resource.monitor.FileWatcher.registerAll(FileWatcher.java:122) [resources-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.resource.monitor.FileWatcher.register(FileWatcher.java:86) [resources-impl-2.1.1.Final.jar:2.1.1.Final]
at org.jboss.forge.addon.resource.monitor.FileMonitor.registerMonitor(FileMonitor.java:86) [resources-impl-2.1.1.Final.jar:2.1.1.Final]
... 22 more
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (FORGE-1622) It would be good if Aesh had access to export variables
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1622:
----------------------------------------
Summary: It would be good if Aesh had access to export variables
Key: FORGE-1622
URL: https://issues.jboss.org/browse/FORGE-1622
Project: Forge
Issue Type: Feature Request
Components: UI - Shell
Affects Versions: 2.1.1.Final
Reporter: Antonio Goncalves
Priority: Minor
Fix For: 2.x Future
This would be a "nice to have" feature from the shell command line.
I'm under OS X and I have a set of variables that I've exported. As an example, all my code is under {{$CODE_HOME}}. It would be good if I code {{cd $CODE_HOME}} when I'm in Aesh :
{code}
~$ cd $CODE_HOME // Under OS X
~/Documents/Code$ forge // Entering Forge
_____
| ___|__ _ __ __ _ ___
| |_ / _ \| `__/ _` |/ _ \ \\
| _| (_) | | | (_| | __/ //
|_| \___/|_| \__, |\___|
|___/
JBoss Forge, version [ 2.1.1.Final ] - JBoss, by Red Hat, Inc.
[Code]$ cd ~
[antoniombp]$ cd $CODE_HOME // Good if it goes to the right directory
[antoniombp]$ echo $CODE_HOME // Doesn't have access to the exported variable
[antoniombp]$
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (FORGE-1621) Creating a jar project with Main should generate an exec-maven-plugin in pom.xml
by Antonio Goncalves (JIRA)
Antonio Goncalves created FORGE-1621:
----------------------------------------
Summary: Creating a jar project with Main should generate an exec-maven-plugin in pom.xml
Key: FORGE-1621
URL: https://issues.jboss.org/browse/FORGE-1621
Project: Forge
Issue Type: Feature Request
Components: Maven
Affects Versions: 2.1.1.Final
Reporter: Antonio Goncalves
Priority: Minor
When creating a project with a {{Main}} class :
{code}
project-new --named mainproj --type jar --createMain
{code}
It would be good to have, in the {{pom.xml}}, a generated {{exec-maven-plugin}} so that we could execute the {{Main}} class with a simple {{mvn exec:java}} command :
{code}
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mainproj</groupId>
<artifactId>mainproj</artifactId>
<version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.mainproj.Main</mainClasss>
</configuration>
</plugin>
</plugins>
</build>
</project>
{code}
See : http://mojo.codehaus.org/exec-maven-plugin/index.html
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (FORGE-1618) Command constraint-new-validator to create a new validator implementation
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1618?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1618:
-------------------------------------
Component/s: Java EE
(was: Scaffold)
> Command constraint-new-validator to create a new validator implementation
> -------------------------------------------------------------------------
>
> Key: FORGE-1618
> URL: https://issues.jboss.org/browse/FORGE-1618
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.1.1.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> An existing constraint can have several implementations of different types. The following commands will create two implementations of the {{Max}} constraints: one for type {{Number}} and one for {{String}} :
> {code}
> constraint-new-validator --named MaxValidatorForNumber --type Number --targetConstraint Max
> constraint-new-validator --named MaxValidatorForString --type String --targetConstraint Max
> {code}
> The generated code would look like this for Number :
> {code}
> public class MaxValidatorForString implements ConstraintValidator<Max, Number> {
> @Override
> public void initialize(URL url) {
> }
> @Override
> public boolean isValid(Number value, ConstraintValidatorContext context) {
> return false;
> }
> }
> {code}
> And like that for String :
> {code}
> public class MaxValidatorForString implements ConstraintValidator<Max, String> {
> @Override
> public void initialize(URL url) {
> }
> @Override
> public boolean isValid(String value, ConstraintValidatorContext context) {
> return false;
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] (FORGE-1617) Command constraint-new-field to add a new field to an existing constraint
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1617?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-1617:
-------------------------------------
Component/s: Java EE
(was: Scaffold)
> Command constraint-new-field to add a new field to an existing constraint
> -------------------------------------------------------------------------
>
> Key: FORGE-1617
> URL: https://issues.jboss.org/browse/FORGE-1617
> Project: Forge
> Issue Type: Sub-task
> Components: Java EE
> Affects Versions: 2.1.1.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> Some constraints need to have fields (attributes). For example, the {{URL}} constraint needs three fields : a protocol, a host, and a port :
> {code}
> constraint-new-field --named protocol --type String --targetConstraint URL
> constraint-new-field --named host --type String --targetConstraint URL
> constraint-new-field --named port --type String --targetConstraint URL
> {code}
> This will add the three attributes to the existing constraint {{URL}} :
> {code}
> @Documented
> @Constraint(validatedBy = URLValidator.class)
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @ReportAsSingleViolation
> public @interface URL {
> String message() default "{org.mycompany.myproject.constraints.URL.message}";
> Class<?>[] groups() default { };
> Class<? extends Payload>[] payload() default { };
> String protocol() default "";
> String host() default "";
> int port() default -1;
> @Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
> @Retention(RUNTIME)
> @Documented
> public @interface List {
> URL[] value();
> }
> }
> {code}
> But it will also add the three attributes to the implementation : attributes and {{initialize}} method :
> {code}
> public class URLValidator implements ConstraintValidator<URL, String> {
> private String protocol;
> private String host;
> private int port;
> @Override
> public void initialize(URL url) {
> this.protocol = url.protocol();
> this.host = url.host();
> this.port = url.port();
> }
> @Override
> public boolean isValid(String value, ConstraintValidatorContext context) {
> return false;
> }
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month