NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Ista Pouss Posted via mailing list.
|
Posted: Wed May 20, 2009 8:41 pm Post subject: How to enable groovy on a maven project ? |
|
|
Hi,
When I want to use groovy on a pure netbeans project, I right clic on
the project, then Properties / Build / Groovy / Enable Groovy and it's
OK.
But on a maven project I don't have this feature. And if I put groovy
in the dependancies, and I create a groovy main class, then I do
SHIFT-F6, netbeans does'nt understand : Exception in thread "main"
java.lang.NoClassDefFoundError: pict/NewGroovyClass, it says.
How is it possible to enable groovy on a maven project ?
Thanks. |
|
| Back to top |
|
 |
mkleint Posted via mailing list.
|
Posted: Thu May 21, 2009 10:37 am Post subject: How to enable groovy on a maven project ? |
|
|
groovy and scala should be enabled if you manually add the src/main/
groovy, src/main/scala folders to your projects and the appropriate
pom configuration. For scala (not sure about groovy) there are some
archetypes that help you setup the project.
Milos
On May 20, 2009, at 10:40 PM, Ista Pouss wrote:
| Quote: | Hi,
When I want to use groovy on a pure netbeans project, I right clic on
the project, then Properties / Build / Groovy / Enable Groovy and it's
OK.
But on a maven project I don't have this feature. And if I put groovy
in the dependancies, and I create a groovy main class, then I do
SHIFT-F6, netbeans does'nt understand : Exception in thread "main"
java.lang.NoClassDefFoundError: pict/NewGroovyClass, it says.
How is it possible to enable groovy on a maven project ?
Thanks. |
|
|
| Back to top |
|
 |
Ista Pouss Posted via mailing list.
|
Posted: Thu May 21, 2009 12:44 pm Post subject: How to enable groovy on a maven project ? |
|
|
2009/5/21 mkleint <address-removed>:
| Quote: | groovy and scala should be enabled if you manually add the src/main/groovy,
src/main/scala folders to your projects and the appropriate pom
configuration. For scala (not sure about groovy) there are some archetypes
that help you setup the project.
Milos
|
It's a little complicated to me. I don't know if it is a netbeans, a
maven or a groovy question.
I follow that : http://groovy.codehaus.org/GMaven+-+Building+Groovy+Projects
I have a groovy class in src/main/groovy/grooo/NewGroovyClass.groovy
That fantastic groovy class :
package grooo
/**
*
* @author herve
*/
class NewGroovyClass
{
static main(String[] args)
{
println "hello"
}
}
If I press F6 from NewGroovyClass : netbeans doesn't find main class
NewGroovyClass.
If I press SHIFT-F6 from NewGroovyClass :
NetBeans: Executing
'/home/herve/java/developpement/apache-maven-2.1.0/bin/mvn
-Dexec.args=-classpath %classpath
-Dexec.executable=/home/herve/java/jdk1.6.0_11/bin/java
process-classes org.codehaus.mojo:exec-maven-plugin:1.1:exec'
NetBeans: JAVA_HOME =/home/herve/java/jdk1.6.0_11
Scanning for projects...
------------------------------------------------------------------------
Building pict
task-segment: [process-classes, org.codehaus.mojo:exec-maven-plugin:1.1:exec]
------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/gmaven-plugin/1.0-rc-3/gmaven-plugin-1.0-rc-3.pom
8K downloaded (gmaven-plugin-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/gmaven-plugin/1.0-rc-3/gmaven-plugin-1.0-rc-3.jar
62K downloaded (gmaven-plugin-1.0-rc-3.jar)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/runtime/gmaven-runtime-loader/1.0-rc-3/gmaven-runtime-loader-1.0-rc-3.pom
2K downloaded (gmaven-runtime-loader-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/support/slf4j-gossip/1.0-rc-3/slf4j-gossip-1.0-rc-3.pom
2K downloaded (slf4j-gossip-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/support/gmaven-support/1.0-rc-3/gmaven-support-1.0-rc-3.pom
1K downloaded (gmaven-support-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/runtime/gmaven-runtime-loader/1.0-rc-3/gmaven-runtime-loader-1.0-rc-3.jar
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/support/slf4j-gossip/1.0-rc-3/slf4j-gossip-1.0-rc-3.jar
6/21K 1/73K
6/21K 2/73K
8/21K 2/73K
9/21K 2/73K
11/21K 2/73K
12/21K 2/73K
13/21K 2/73K
15/21K 2/73K
16/21K 2/73K
18/21K 2/73K
18/21K 4/73K
18/21K 5/73K
18/21K 6/73K
18/21K 8/73K
19/21K 8/73K
20/21K 8/73K
21/21K 8/73K
21K downloaded (gmaven-runtime-loader-1.0-rc-3.jar)
73K downloaded (slf4j-gossip-1.0-rc-3.jar)
[groovy:generateStubs {execution: default}]
Generated 1 Java stub
[resources:resources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
skip non existing resourceDirectory
/home/herve/jetravaille/netbeans/pict/src/main/resources
[compiler:compile]
Compiling 1 source file to /home/herve/jetravaille/netbeans/pict/target/classes
[groovy:compile {execution: default}]
Compiled 1 Groovy class
[exec:exec]
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is server,
because you are running on a server-class machine.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 19 seconds
Finished at: Thu May 21 14:29:02 CEST 2009
Final Memory: 23M/71M
------------------------------------------------------------------------
It's NOT successful !!! (I don't see "hello"). |
|
| Back to top |
|
 |
mkleint Posted via mailing list.
|
Posted: Thu May 21, 2009 12:54 pm Post subject: How to enable groovy on a maven project ? |
|
|
could be a bug, not even sure running groovy files is supported ATM, All
I tried when testing the integration was code completion and that groovy
classes can be used by java and vice versa.
Please file as bug, I'll look into it, a sample project would help.
The build successful thing is an isue with the exec-maven-plugin I guess.
Milos
Ista Pouss wrote:
| Quote: | 2009/5/21 mkleint <address-removed>:
| Quote: | groovy and scala should be enabled if you manually add the src/main/groovy,
src/main/scala folders to your projects and the appropriate pom
configuration. For scala (not sure about groovy) there are some archetypes
that help you setup the project.
Milos
|
It's a little complicated to me. I don't know if it is a netbeans, a
maven or a groovy question.
I follow that : http://groovy.codehaus.org/GMaven+-+Building+Groovy+Projects
I have a groovy class in src/main/groovy/grooo/NewGroovyClass.groovy
That fantastic groovy class :
package grooo
/**
*
* @author herve
*/
class NewGroovyClass
{
static main(String[] args)
{
println "hello"
}
}
If I press F6 from NewGroovyClass : netbeans doesn't find main class
NewGroovyClass.
If I press SHIFT-F6 from NewGroovyClass :
NetBeans: Executing
'/home/herve/java/developpement/apache-maven-2.1.0/bin/mvn
-Dexec.args=-classpath %classpath
-Dexec.executable=/home/herve/java/jdk1.6.0_11/bin/java
process-classes org.codehaus.mojo:exec-maven-plugin:1.1:exec'
NetBeans: JAVA_HOME =/home/herve/java/jdk1.6.0_11
Scanning for projects...
------------------------------------------------------------------------
Building pict
task-segment: [process-classes, org.codehaus.mojo:exec-maven-plugin:1.1:exec]
------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/gmaven-plugin/1.0-rc-3/gmaven-plugin-1.0-rc-3.pom
8K downloaded (gmaven-plugin-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/gmaven-plugin/1.0-rc-3/gmaven-plugin-1.0-rc-3.jar
62K downloaded (gmaven-plugin-1.0-rc-3.jar)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/runtime/gmaven-runtime-loader/1.0-rc-3/gmaven-runtime-loader-1.0-rc-3.pom
2K downloaded (gmaven-runtime-loader-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/support/slf4j-gossip/1.0-rc-3/slf4j-gossip-1.0-rc-3.pom
2K downloaded (slf4j-gossip-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/support/gmaven-support/1.0-rc-3/gmaven-support-1.0-rc-3.pom
1K downloaded (gmaven-support-1.0-rc-3.pom)
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/runtime/gmaven-runtime-loader/1.0-rc-3/gmaven-runtime-loader-1.0-rc-3.jar
Downloading: http://repo1.maven.org/maven2/org/codehaus/groovy/maven/support/slf4j-gossip/1.0-rc-3/slf4j-gossip-1.0-rc-3.jar
6/21K 1/73K
6/21K 2/73K
8/21K 2/73K
9/21K 2/73K
11/21K 2/73K
12/21K 2/73K
13/21K 2/73K
15/21K 2/73K
16/21K 2/73K
18/21K 2/73K
18/21K 4/73K
18/21K 5/73K
18/21K 6/73K
18/21K 8/73K
19/21K 8/73K
20/21K 8/73K
21/21K 8/73K
21K downloaded (gmaven-runtime-loader-1.0-rc-3.jar)
73K downloaded (slf4j-gossip-1.0-rc-3.jar)
[groovy:generateStubs {execution: default}]
Generated 1 Java stub
[resources:resources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered
resources, i.e. build is platform dependent!
skip non existing resourceDirectory
/home/herve/jetravaille/netbeans/pict/src/main/resources
[compiler:compile]
Compiling 1 source file to /home/herve/jetravaille/netbeans/pict/target/classes
[groovy:compile {execution: default}]
Compiled 1 Groovy class
[exec:exec]
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is server,
because you are running on a server-class machine.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
------------------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 19 seconds
Finished at: Thu May 21 14:29:02 CEST 2009
Final Memory: 23M/71M
------------------------------------------------------------------------
It's NOT successful !!! (I don't see "hello").
|
|
|
| Back to top |
|
 |
Ista Pouss Posted via mailing list.
|
Posted: Thu May 21, 2009 1:36 pm Post subject: How to enable groovy on a maven project ? |
|
|
2009/5/21 mkleint <address-removed>:
| Quote: | could be a bug, not even sure running groovy files is supported ATM, All I
tried when testing the integration was code completion and that groovy
classes can be used by java and vice versa.
Please file as bug, I'll look into it, a sample project would help.
|
Here is : http://www.netbeans.org/issues/show_bug.cgi?id=165705
Thanks. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|