You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by emerson <ec...@gmail.com> on 2010/10/11 13:30:06 UTC

Maven generating invalid eclipse projects

Hi

I configured a integration test only project, in a way that every
module uses a configuration that is stored in the parent folder.
I implemented this way:

In the parent pom (in the root of the tree):

     <properties>
      <envType>local</envType> <!-- Default Environment value -->
      <envProps>../autotestProperties/</envProps>
    </properties>
	<build>
    <resources>
      <resource>
        <directory>${envProps}/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <filters>
        <filter>${envProps}/env/${envType}.properties</filter>
    </filters>

Then each module will get the generated configuration at the classpath.

As far as maven goes, it works fine, but when I generate the
correspondent eclipse project, it tries to add the resource entry, but
all it gets is a incorrect build path entry:

"Build path entry is missing:
home/emerson/workspace/trunk/autotests/autotestProperties/resources"

Is there anyway to stop eclipse from trying to create this entry?

The normal use of this will be for the developers and qa to create the
project structure using  "maven eclipse:eclipse install -DskipTests"
once via maven and then run the tests straight from eclipse.

Regards
Emerson

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


Re: Maven generating invalid eclipse projects

Posted by Antonio Petrelli <an...@gmail.com>.
2010/11/10 emerson <ec...@gmail.com>:
> When I import the project using eclipse2m, the source folder entry for
> the src/test/scenarios have Included: (All) and Excluded: **

Yes, it is annoying. There's an old JIRA issue for it:
https://issues.sonatype.org/browse/MNGECLIPSE-784

Antonio

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


Re: Maven generating invalid eclipse projects

Posted by emerson <ec...@gmail.com>.
I tried the m2eclipse, but that also seems to import a wrong build path.

I have the following entry on my parent pom.xml

<build>
<testResources>
      <testResource>
        <directory>src/test/scenarios</directory>
      </testResource>
    </testResources>
<plugins>
 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <testResources>
            <testResource>
              <directory>src/test/scenarios</directory>
            </testResource>
          </testResources>
          <excludes>
            <exclude>**/*Steps.java</exclude>
            <exclude>../*Steps.java</exclude>
          </excludes>
          <testFailureIgnore>true</testFailureIgnore>
        </configuration>
      </plugin>
      <plugin>
<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>/src/test/scenarios</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>


When I import the project using eclipse2m, the source folder entry for
the src/test/scenarios have Included: (All) and Excluded: **

That causes the jbehave tests to not to run properly, which is even
worse than using the maven eclipse plugin to generate the eclipse
files.

Any idea if I'm doing something wrong?

Also an unrelated question, is it really necessary to add the
build-helper-maven-plugin and the maven-surefire-plugin bits of
configuration for tests to read from the scenarios folder?

Regards
Emerson

On 13 October 2010 13:39, Antonio Petrelli <an...@gmail.com> wrote:
> 2010/10/13 emerson <ec...@gmail.com>:
>> Does the m2eclipse creates eclipse config from the pom, ina
>> multi-module configuration?
>
> it creates one Eclipse project per module, plus the project for the master pom.
> And, obviously, the config files.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Maven generating invalid eclipse projects

Posted by Antonio Petrelli <an...@gmail.com>.
2010/10/13 emerson <ec...@gmail.com>:
> Does the m2eclipse creates eclipse config from the pom, ina
> multi-module configuration?

it creates one Eclipse project per module, plus the project for the master pom.
And, obviously, the config files.

Antonio

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


Re: Maven generating invalid eclipse projects

Posted by emerson <ec...@gmail.com>.
> The first step is to run eclipse:eclipse
>
> Then copy the generated files somewhere.
>
> The second step is to manually fix eclipse so that it is how you expect it.
>
> Then copy those files somewhere.
>
> Compare the two and file a bug report
> http://maven.apache.org/plugins/maven-eclipse-plugin/
>
> Better yet, download the source, run a new integration test and then a
> fix for the problem before you submit the bug report.
>
> A lot of people are moving to m2eclipse http://m2eclipse.sonatype.org/.
> There are only a few developers looking at m-e-p.
>

Does the m2eclipse creates eclipse config from the pom, ina
multi-module configuration?

regards
Emerson

On 12 October 2010 07:23, Barrie Treloar <ba...@gmail.com> wrote:
> On Mon, Oct 11, 2010 at 10:00 PM, emerson <ec...@gmail.com> wrote:
>> Hi
>>
>> I configured a integration test only project, in a way that every
>> module uses a configuration that is stored in the parent folder.
>> I implemented this way:
>>
>> In the parent pom (in the root of the tree):
>>
>>     <properties>
>>      <envType>local</envType> <!-- Default Environment value -->
>>      <envProps>../autotestProperties/</envProps>
>>    </properties>
>>        <build>
>>    <resources>
>>      <resource>
>>        <directory>${envProps}/resources</directory>
>>        <filtering>true</filtering>
>>      </resource>
>>    </resources>
>>    <filters>
>>        <filter>${envProps}/env/${envType}.properties</filter>
>>    </filters>
>>
>> Then each module will get the generated configuration at the classpath.
>>
>> As far as maven goes, it works fine, but when I generate the
>> correspondent eclipse project, it tries to add the resource entry, but
>> all it gets is a incorrect build path entry:
>>
>> "Build path entry is missing:
>> home/emerson/workspace/trunk/autotests/autotestProperties/resources"
>>
>> Is there anyway to stop eclipse from trying to create this entry?
>>
>> The normal use of this will be for the developers and qa to create the
>> project structure using  "maven eclipse:eclipse install -DskipTests"
>> once via maven and then run the tests straight from eclipse.
>

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

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


Re: Maven generating invalid eclipse projects

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Oct 11, 2010 at 10:00 PM, emerson <ec...@gmail.com> wrote:
> Hi
>
> I configured a integration test only project, in a way that every
> module uses a configuration that is stored in the parent folder.
> I implemented this way:
>
> In the parent pom (in the root of the tree):
>
>     <properties>
>      <envType>local</envType> <!-- Default Environment value -->
>      <envProps>../autotestProperties/</envProps>
>    </properties>
>        <build>
>    <resources>
>      <resource>
>        <directory>${envProps}/resources</directory>
>        <filtering>true</filtering>
>      </resource>
>    </resources>
>    <filters>
>        <filter>${envProps}/env/${envType}.properties</filter>
>    </filters>
>
> Then each module will get the generated configuration at the classpath.
>
> As far as maven goes, it works fine, but when I generate the
> correspondent eclipse project, it tries to add the resource entry, but
> all it gets is a incorrect build path entry:
>
> "Build path entry is missing:
> home/emerson/workspace/trunk/autotests/autotestProperties/resources"
>
> Is there anyway to stop eclipse from trying to create this entry?
>
> The normal use of this will be for the developers and qa to create the
> project structure using  "maven eclipse:eclipse install -DskipTests"
> once via maven and then run the tests straight from eclipse.

The first step is to run eclipse:eclipse

Then copy the generated files somewhere.

The second step is to manually fix eclipse so that it is how you expect it.

Then copy those files somewhere.

Compare the two and file a bug report
http://maven.apache.org/plugins/maven-eclipse-plugin/

Better yet, download the source, run a new integration test and then a
fix for the problem before you submit the bug report.

A lot of people are moving to m2eclipse http://m2eclipse.sonatype.org/.
There are only a few developers looking at m-e-p.

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