Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-06-29 Thread Sebastian Goldt
Hi all,

today, I run into some problems with the Maven Eclipse Plugin 2.8 using
Maven 3.0.3 on an Ubuntu 11.04 while setting up a mixed Java / Groovy
project. It seems as if the eclipse plugin doesn't include all source code
folders in the generated .project file. I haven't found anything on the
internet on that particular issue so far...

*Details:*

My project in question contains both tests and main source code in java as
well as in groovy, so I have the four folders src/main/java,
src/main/groovy, src/test/java and src/test/groovy which are added to the
project with the Build Helper Maven Plugin (1.6). When I generate the
eclipse project files using eclipse:eclipse, the generated .classpath file
only contains the src/main/groovy folder and not the src/test/groovy folder.

*Reproduction:*
The easiest way to reproduce the problem is by using a java/groovy project
quickstarter from codehaus:

   1. Create a dummy groovy/java project by using typing:

   mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy
   -DarchetypeArtifactId=groovy-eclipse-quickstart
   -DarchetypeVersion=2.5.1-M3-SNAPSHOT -DgroupId=foo -DartifactId=bar
   -Dversion=1 -DinteractiveMode=false -DarchetypeRepository=
   https://nexus.codehaus.org/content/repositories/snapshots/

   2. Create Eclipse project files

   mvn eclipse:eclipse

When inspecting the generated .classpath file, you will notice that the
src/test/groovy path is missing.

Note that if you wanted to import the project into eclipse, you would have
to set up the eclipse plugin in your pom as to include *.groovy classes on
your build path and properly organise the files in packages; however, this
wouldn't change the actual problem in any way.

*Workaround:*
Simply import the project into Eclipse and declare the src/test/groovy
folder as source folder.

Is this a bug or is there another mistake?

Regards,
Sebastian


Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-06-30 Thread Guillaume Polet

It's an M2Eclipse problem. I think you should rather user their ML.

--
Guillaume

Le 29/06/2011 17:15, Sebastian Goldt a écrit :

Hi all,

today, I run into some problems with the Maven Eclipse Plugin 2.8 using
Maven 3.0.3 on an Ubuntu 11.04 while setting up a mixed Java / Groovy
project. It seems as if the eclipse plugin doesn't include all source code
folders in the generated .project file. I haven't found anything on the
internet on that particular issue so far...

*Details:*

My project in question contains both tests and main source code in java as
well as in groovy, so I have the four folders src/main/java,
src/main/groovy, src/test/java and src/test/groovy which are added to the
project with the Build Helper Maven Plugin (1.6). When I generate the
eclipse project files using eclipse:eclipse, the generated .classpath file
only contains the src/main/groovy folder and not the src/test/groovy folder.

*Reproduction:*
The easiest way to reproduce the problem is by using a java/groovy project
quickstarter from codehaus:

1. Create a dummy groovy/java project by using typing:

mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy
-DarchetypeArtifactId=groovy-eclipse-quickstart
-DarchetypeVersion=2.5.1-M3-SNAPSHOT -DgroupId=foo -DartifactId=bar
-Dversion=1 -DinteractiveMode=false -DarchetypeRepository=
https://nexus.codehaus.org/content/repositories/snapshots/

2. Create Eclipse project files

mvn eclipse:eclipse

When inspecting the generated .classpath file, you will notice that the
src/test/groovy path is missing.

Note that if you wanted to import the project into eclipse, you would have
to set up the eclipse plugin in your pom as to include *.groovy classes on
your build path and properly organise the files in packages; however, this
wouldn't change the actual problem in any way.

*Workaround:*
Simply import the project into Eclipse and declare the src/test/groovy
folder as source folder.

Is this a bug or is there another mistake?

Regards,
Sebastian




-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-06-30 Thread Barrie Treloar
On Thu, Jun 30, 2011 at 4:43 PM, Guillaume Polet
 wrote:
> It's an M2Eclipse problem. I think you should rather user their ML.
[del]
>>    mvn eclipse:eclipse

He's not using m2e.

I'm looking into it...

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-06-30 Thread Barrie Treloar
On Thu, Jun 30, 2011 at 12:45 AM, Sebastian Goldt  wrote:
[del]
> My project in question contains both tests and main source code in java as
> well as in groovy, so I have the four folders src/main/java,
> src/main/groovy, src/test/java and src/test/groovy which are added to the
> project with the Build Helper Maven Plugin (1.6). When I generate the
> eclipse project files using eclipse:eclipse, the generated .classpath file
> only contains the src/main/groovy folder and not the src/test/groovy folder.
>
> *Reproduction:*
> The easiest way to reproduce the problem is by using a java/groovy project
> quickstarter from codehaus:
>
>   1. Create a dummy groovy/java project by using typing:
>
>   mvn archetype:generate     -DarchetypeGroupId=org.codehaus.groovy
>   -DarchetypeArtifactId=groovy-eclipse-quickstart
>   -DarchetypeVersion=2.5.1-M3-SNAPSHOT     -DgroupId=foo     -DartifactId=bar
>       -Dversion=1     -DinteractiveMode=false     -DarchetypeRepository=
>   https://nexus.codehaus.org/content/repositories/snapshots/

Created an IT for this case to see what happens

>   2. Create Eclipse project files
>
>   mvn eclipse:eclipse
>
> When inspecting the generated .classpath file, you will notice that the
> src/test/groovy path is missing.
>
> Note that if you wanted to import the project into eclipse, you would have
> to set up the eclipse plugin in your pom as to include *.groovy classes on
> your build path and properly organise the files in packages; however, this
> wouldn't change the actual problem in any way.

m-e-p will run anything else bound to

  
default


  
  
  
  


  

So it should run build-helper to attach the groovy directories.

I can see in the debug logs
[DEBUG] testOutput toRelativeAndFixSeparator
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy
, 
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy\target\test-classes
[DEBUG] testOutput after toRelative : target/test-classes
[DEBUG] Processing resource dir:
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy\src\main\resources
[DEBUG] Resource dir:
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy\src\main\resources
either missing or not a directory.
[DEBUG] Processing resource dir:
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy\src\test\resources
[DEBUG] Resource dir:
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy\src\test\resources
either missing or not a directory.
[INFO] Not writing settings - defaults suffice
[DEBUG] Processing classpath for: source src/test/java:
output=target/test-classes, include=[**/*.java], exclude=[],
test=true, filtering=false; default output=target/classes
[DEBUG] Processing classpath for: source src/main/java: output=null,
include=[**/*.java], exclude=[], test=false, filtering=false; default
output=target/classes
[DEBUG] Processing classpath for: source src/main/groovy: output=null,
include=[**/*.java], exclude=[], test=false, filtering=false; default
output=target/classes
[INFO] Wrote Eclipse project for "bar" to
D:\ide\maven\maven-eclipse-plugin\target\test-classes\projects\groovy.

So groovy is available in the src directory list.

The generated .classpath

  
  
  
  
  
  
  


This is using the latest released m-eclipse-p of 2.8.

Try running
  mvn -X eclipse:eclipse

This will print out the debug statements.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-06-30 Thread Anders Hammar
On Thu, Jun 30, 2011 at 09:13, Guillaume Polet wrote:

> It's an M2Eclipse problem. I think you should rather user their ML.
>
>
No, he's using the maven-eclipse-plugin. Not m2eclipse.

/Anders


> --
> Guillaume
>
> Le 29/06/2011 17:15, Sebastian Goldt a écrit :
>
>> Hi all,
>>
>> today, I run into some problems with the Maven Eclipse Plugin 2.8 using
>> Maven 3.0.3 on an Ubuntu 11.04 while setting up a mixed Java / Groovy
>> project. It seems as if the eclipse plugin doesn't include all source code
>> folders in the generated .project file. I haven't found anything on the
>> internet on that particular issue so far...
>>
>> *Details:*
>>
>> My project in question contains both tests and main source code in java as
>> well as in groovy, so I have the four folders src/main/java,
>> src/main/groovy, src/test/java and src/test/groovy which are added to the
>> project with the Build Helper Maven Plugin (1.6). When I generate the
>> eclipse project files using eclipse:eclipse, the generated .classpath file
>> only contains the src/main/groovy folder and not the src/test/groovy
>> folder.
>>
>> *Reproduction:*
>> The easiest way to reproduce the problem is by using a java/groovy project
>> quickstarter from codehaus:
>>
>>1. Create a dummy groovy/java project by using typing:
>>
>>mvn archetype:generate -DarchetypeGroupId=org.**codehaus.groovy
>>-DarchetypeArtifactId=groovy-**eclipse-quickstart
>>-DarchetypeVersion=2.5.1-M3-**SNAPSHOT -DgroupId=foo
>> -DartifactId=bar
>>-Dversion=1 -DinteractiveMode=false -DarchetypeRepository=
>>
>> https://nexus.codehaus.org/**content/repositories/**snapshots/
>>
>>2. Create Eclipse project files
>>
>>mvn eclipse:eclipse
>>
>> When inspecting the generated .classpath file, you will notice that the
>> src/test/groovy path is missing.
>>
>> Note that if you wanted to import the project into eclipse, you would have
>> to set up the eclipse plugin in your pom as to include *.groovy classes on
>> your build path and properly organise the files in packages; however, this
>> wouldn't change the actual problem in any way.
>>
>> *Workaround:*
>> Simply import the project into Eclipse and declare the src/test/groovy
>> folder as source folder.
>>
>> Is this a bug or is there another mistake?
>>
>> Regards,
>> Sebastian
>>
>>
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@maven.**apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-07-04 Thread Barrie Treloar
> On Thu, Jun 30, 2011 at 12:45 AM, Sebastian Goldt  wrote:

Sebastian, its been five days and no feedback.

Have you worked out your problem?
Has any of this thread been useful?

It would be nice from an archive perspective if you could comment on
your resolution so others can avoid this problem in the future.
Especially if there was something not clear that caused you to make a
mistake, that would be a good opportunity to fix up any documentation
so others don't have the same problems.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-07-13 Thread DaveyBob
I essentially have the same problem.  I am just getting started with Groovy
for this project.

Environment:
  Ubuntu 11.04
  Eclipse 3.7
  Groovy Eclipse plugin 2.5.1
  Maven 2.2.1

Following the instructions in the Groovy Eclipse Plugin page
(http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven), I ran
the mvn archetype:generate command, and it generated a project for me.  Then
I did mvn eclipse:eclipse and then imported that project into Eclipse.

But the project flags errors in src/test/java/JavaTest because the package
is not right.  Fixed that.

Next src/main/java/JavaMain.java is in error because it cannot find
GroovyHello.  Sure enough, that is not compiled.  So I checked the build
path, and like Sebastian found, src/main/groovy does not include groovy
files at all...so I added an include of **/*.groovy.

That still doesn't fix it, though.  None of the groovy files ever get
compiled to .class files in the output folder.  At this point I don't have a
clue how to get Eclipse to build these files.

I think I'll come at it from the Eclipse side and create a Groovy project.


--
View this message in context: 
http://maven.40175.n5.nabble.com/Maven-Eclipse-Plugin-doesn-t-include-all-source-paths-in-generated-classpath-file-in-a-Java-Groovy-pt-tp4535545p4583476.html
Sent from the Maven - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-07-13 Thread Jeff MAURY
You probably need to configure your Eclipse project as a Groovy project
(through a nature I think).
Please not that you can configure the Maven Eclipse plugin to add specific
natures when eclipse:eclipse is run.

Regards
Jeff


On Wed, Jul 13, 2011 at 7:26 PM, DaveyBob  wrote:

> I essentially have the same problem.  I am just getting started with Groovy
> for this project.
>
> Environment:
>  Ubuntu 11.04
>  Eclipse 3.7
>  Groovy Eclipse plugin 2.5.1
>  Maven 2.2.1
>
> Following the instructions in the Groovy Eclipse Plugin page
> (http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven), I
> ran
> the mvn archetype:generate command, and it generated a project for me.
>  Then
> I did mvn eclipse:eclipse and then imported that project into Eclipse.
>
> But the project flags errors in src/test/java/JavaTest because the package
> is not right.  Fixed that.
>
> Next src/main/java/JavaMain.java is in error because it cannot find
> GroovyHello.  Sure enough, that is not compiled.  So I checked the build
> path, and like Sebastian found, src/main/groovy does not include groovy
> files at all...so I added an include of **/*.groovy.
>
> That still doesn't fix it, though.  None of the groovy files ever get
> compiled to .class files in the output folder.  At this point I don't have
> a
> clue how to get Eclipse to build these files.
>
> I think I'll come at it from the Eclipse side and create a Groovy project.
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-Eclipse-Plugin-doesn-t-include-all-source-paths-in-generated-classpath-file-in-a-Java-Groovy-pt-tp4535545p4583476.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


-- 
"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury


Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-07-13 Thread Barrie Treloar
On Thu, Jul 14, 2011 at 3:09 AM, Jeff MAURY  wrote:
> You probably need to configure your Eclipse project as a Groovy project
> (through a nature I think).
> Please not that you can configure the Maven Eclipse plugin to add specific
> natures when eclipse:eclipse is run.

Groovy support in maven-eclipse-plugin may not be complete.
You are welcome to provide patches with test cases to fix this.

And Sebastian, it would be nice to hear how you went.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: Maven Eclipse Plugin doesn't include all source paths in generated .classpath file in a Java / Groovy project

2011-07-13 Thread Barrie Treloar
On Thu, Jul 14, 2011 at 9:07 AM, Barrie Treloar  wrote:
> On Thu, Jul 14, 2011 at 3:09 AM, Jeff MAURY  wrote:
>> You probably need to configure your Eclipse project as a Groovy project
>> (through a nature I think).
>> Please not that you can configure the Maven Eclipse plugin to add specific
>> natures when eclipse:eclipse is run.
>
> Groovy support in maven-eclipse-plugin may not be complete.
> You are welcome to provide patches with test cases to fix this.

I can see from the IT pom that there are no Groovy natures installed.

But when you run mvn compile it will compile the Groovy files.
See 
http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/src/test/resources/projects/groovy/pom.xml

Their documentation
(http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven)
has a bug
  
  


  
org.eclipse.jdt.groovy.core.groovyNature
  

  
  ...
What's the artifactId?
I think it should be maven-eclipse-plugin.

And their archetype also needs updating to match their documentation
as it does not include this configuration.

I've updated the IT pom to include the nature now.
But its still a manual job for any groovy users to do this, its not
something maven-eclipse-plugin can do automatically for you.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org