You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sarmahdi <sa...@hotmail.com> on 2012/03/04 16:58:25 UTC

eclipse plugin has a POM of its own

Hello All,

I was using maven standalone and working fine. but then i wanted to port
this project into eclipse so I downloaded the maven plugin me2Eclipse and
imported the project into eclipse. When I opened the POM.xml the file opened
as forms. so for all the sections there was a form which is a good thing.
BUT, there was an uneditable POM called *Effective POM* besides the pom.xml
source. what is happening is that the things that were missing from my POM
are read from there. and things that are missing from my POM the maven
outside the IDE was adjusting them quite favorably for my project.

When i was using maven outside the IDE it was working fine: but now the
Effective POM has some plugins listed in the <pluginmanagement> area that
are of older versions than the ones I was using and are in my repo already.
and because its uneditable i cant modify it so i have to over ride those in
my pom.xml. 

(I understand that eclipse is only telling me the actual Effective POM thats
gonna play when my maven runs on it) but how do i over ride it or what to do
now. My old structure was in place and all working with this new POM
although it shows me how to write a good POM but its confusing to get things
configured at two places.

Has any body had this issue and tried to work with it. the best thing was
that it showed me these tags and  how to specify my own project structure
(similar to eclipse) so I dont need to follow maven conventions



<build>
	

<sourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src</sourceDirectory>
  
<scriptSourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src\main\scripts</scriptSourceDirectory>
   
<testSourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src\test\java</testSourceDirectory>
   
<outputDirectory>C:\RSA75Workspace\workspace\finAppWeb\target\build\classes</outputDirectory>
   
<testOutputDirectory>C:\RSA75Workspace\workspace\finAppWeb\target\test-classes</testOutputDirectory>
    <resources>
      <resource>
       
<directory>C:\RSA75Workspace\workspace\finAppWeb\src\main\resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
       
<directory>C:\RSA75Workspace\workspace\finAppWeb\src\test\resources</directory>
      </testResource>
    </testResources>
    <directory>C:\RSA75Workspace\workspace\finAppWeb\target</directory>
    <finalName>finAppWeb-0.0.1-SNAPSHOT</finalName>
<plugins>........
</build>

Is there a way to specify where my webApp folder is like the
<sourceDirectory>. The Effective POM doesn't list it. Also they are all
local paths, can I not give workspace specific path so that they can be
ported to some other directory and still work.

Thanks
Syed...



--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5535417.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: eclipse plugin has a POM of its own

Posted by sarmahdi <sa...@hotmail.com>.
Thanks Anders,

Yes you are right the plugin that installed with eclipse was different than
the one i installed with netbeans(thats what i was using outside the IDE as
well)

but here is the thing now, whihc is ticking me off with eclipse plugin for
maven.

I dont know why but now when I am running the goals "clean install" it is
doing everything as per my wishes with one exception when i was doing it
outside the IDES, (using the maven installed with netbeans) the classes
folder only had classes but now the java classes are also added within them.
the maven with netbeans didnt had to be configured SO much, this eclipse one
needs to be baby feed every configuration hence making my POM more absurdly
verbose than the previous one. AND its accomplishing the same things I was
achieving before.

this is just uselessly wasting my time, my POM was good enough to complete
the build, I even changed the maven run time (going into Run As.. > Run
Configurations> changing the maven runtime to Maven inside Netbeans )

Do you think that becuase i changed the source directory and listed the
webapp directory that it is now ADDing the java files as well with the
classes. I dont think they should be related in any way.

Thanks for the comments and hints and suggestions.

Syed...


--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5537027.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: eclipse plugin has a POM of its own

Posted by Anders Hammar <an...@hammar.net>.
It might be that you're using different Maven versions. What version
of Maven are you using from command-line? m2e (Eclipse) is using Maven
3.0.2+some patches (or 3.0.3 if you've installed the upgraded
embedder).

If you're using different Maven versions, different Super-POMs are
used with different versions specified for the plugins. Thus, you
should ALWAYS specify the version of the plugins your project is
using!

/Anders

On Mon, Mar 5, 2012 at 08:23, sarmahdi <sa...@hotmail.com> wrote:
> Thanks for the reply Ron, appreciate it
>
> The question is that why would i need to overriding your plug-in versions
> now that I am in eclipse, outside of my eclipse i was doing fine and running
> the POM as IS . now that I have ported it into eclipse why are the settings
> different. I know your answer would be settings in eclipse for maven and
> java. but I am only saying that why are they so different or OLD. I am
> thinking that the eclipse maven plugin i downloaded was the older version
> and it is the one making problems.
> but i appreciate your answer.
>
> I guess you are right. it was confusing me esp because i just started to
> work with maven and it was awesomely working for me.
>
> Anyways thanks.
>
> I will post another question for the webappsources location in POM. if there
> is such a thing like that.
>
> Thanks.
> Syed...
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5536744.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: eclipse plugin has a POM of its own

Posted by sarmahdi <sa...@hotmail.com>.
Thanks for the reply Ron, appreciate it

The question is that why would i need to overriding your plug-in versions
now that I am in eclipse, outside of my eclipse i was doing fine and running
the POM as IS . now that I have ported it into eclipse why are the settings
different. I know your answer would be settings in eclipse for maven and
java. but I am only saying that why are they so different or OLD. I am
thinking that the eclipse maven plugin i downloaded was the older version
and it is the one making problems. 
but i appreciate your answer. 

I guess you are right. it was confusing me esp because i just started to
work with maven and it was awesomely working for me. 

Anyways thanks.

I will post another question for the webappsources location in POM. if there
is such a thing like that.

Thanks.
Syed...



--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5536744.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: eclipse plugin has a POM of its own

Posted by Ron Wheeler <rw...@artifact-software.com>.
The effective POM is just your project POM merged with the Maven super 
POM, the project's parent POM, your settings.XML and the settings in 
Eclipse for Maven and Java.

You need to check your Eclipse workspace and project properties to see 
how Maven and Java are set up in your Eclipse settings.

You should be overriding your plug-in versions in your project POM or 
parent POM so that you control what versions are in use and so that you 
get the same build inside Eclipse and outside.

This is normal behaviour for Eclipse and Maven.


Ron


On 04/03/2012 10:58 AM, sarmahdi wrote:
> Hello All,
>
> I was using maven standalone and working fine. but then i wanted to port
> this project into eclipse so I downloaded the maven plugin me2Eclipse and
> imported the project into eclipse. When I opened the POM.xml the file opened
> as forms. so for all the sections there was a form which is a good thing.
> BUT, there was an uneditable POM called *Effective POM* besides the pom.xml
> source. what is happening is that the things that were missing from my POM
> are read from there. and things that are missing from my POM the maven
> outside the IDE was adjusting them quite favorably for my project.
>
> When i was using maven outside the IDE it was working fine: but now the
> Effective POM has some plugins listed in the<pluginmanagement>  area that
> are of older versions than the ones I was using and are in my repo already.
> and because its uneditable i cant modify it so i have to over ride those in
> my pom.xml.
>
> (I understand that eclipse is only telling me the actual Effective POM thats
> gonna play when my maven runs on it) but how do i over ride it or what to do
> now. My old structure was in place and all working with this new POM
> although it shows me how to write a good POM but its confusing to get things
> configured at two places.
>
> Has any body had this issue and tried to work with it. the best thing was
> that it showed me these tags and  how to specify my own project structure
> (similar to eclipse) so I dont need to follow maven conventions
>
>
>
> <build>
> 	
>
> <sourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src</sourceDirectory>
>
> <scriptSourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src\main\scripts</scriptSourceDirectory>
>
> <testSourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src\test\java</testSourceDirectory>
>
> <outputDirectory>C:\RSA75Workspace\workspace\finAppWeb\target\build\classes</outputDirectory>
>
> <testOutputDirectory>C:\RSA75Workspace\workspace\finAppWeb\target\test-classes</testOutputDirectory>
>      <resources>
>        <resource>
>
> <directory>C:\RSA75Workspace\workspace\finAppWeb\src\main\resources</directory>
>        </resource>
>      </resources>
>      <testResources>
>        <testResource>
>
> <directory>C:\RSA75Workspace\workspace\finAppWeb\src\test\resources</directory>
>        </testResource>
>      </testResources>
>      <directory>C:\RSA75Workspace\workspace\finAppWeb\target</directory>
>      <finalName>finAppWeb-0.0.1-SNAPSHOT</finalName>
> <plugins>........
> </build>
>
> Is there a way to specify where my webApp folder is like the
> <sourceDirectory>. The Effective POM doesn't list it. Also they are all
> local paths, can I not give workspace specific path so that they can be
> ported to some other directory and still work.
>
> Thanks
> Syed...
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5535417.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: Re: Antwort: eclipse plugin has a POM of its own

Posted by sarmahdi <sa...@hotmail.com>.
i replaced my project path to  ${basedir} this is where the maven POM is
located so it knows its root or ${basedir}

Can any one tell me if maven knows the workspace directory where the
${basedir} is located. I know impossible i guess but doesnt hurt to try.

Thanks.
Syed..

--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5541066.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Re: Antwort: eclipse plugin has a POM of its own

Posted by Thorsten Heit <th...@vkb.de>.
Hi Syed,

> Yeah thats a good suggestion. Also can you tell me how to remove the
> C:\RSA75Workspace\workspace/ blah blah to some thing relative to 
workspace??
> so that the POM is portable to another workspace.

According to your initial post the effective pom lets me guess that you're 
using the standard directory layout. The absolute paths are the ones Maven 
resolves from your pom.
As long as you don't have hardcoded entries in that file, your project 
should be perfectly portable to other workspaces/machines/users. You only 
have to take care if you're using relative paths, but as long as they are 
relative to your project, that shouldn't matter.

If you have to use a different directory layout, I suggest you have a look 
at the documentation ([1]), especially [2]. Depending on the plugins 
you're using you should also have a look at their documentation ([3]); 
perhaps their configuration has to be adapted to fit your project layout.


[1] http://maven.apache.org/guides/index.html
[2] 
http://maven.apache.org/guides/mini/guide-using-one-source-directory.html
[3] http://maven.apache.org/plugins/index.html


Regards

Thorsten

Re: Antwort: eclipse plugin has a POM of its own

Posted by sarmahdi <sa...@hotmail.com>.
Thanks Thorsten,

Yeah thats a good suggestion. Also can you tell me how to remove the
C:\RSA75Workspace\workspace/ blah blah to some thing relative to workspace??
so that the POM is portable to another workspace.

Thanks
Syed...

--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5537031.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Antwort: eclipse plugin has a POM of its own

Posted by sarmahdi <sa...@hotmail.com>.
Thanks Thorsten,

Yeah thats a good suggestion. Also can you tell me how to remove the
C:\RSA75Workspace\workspace/ blah blah to some thing relative to workspace??
so that the POM is portable to another workspace.

Thanks
Syed...

--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5537030.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Antwort: eclipse plugin has a POM of its own

Posted by sarmahdi <sa...@hotmail.com>.
Thanks Thorsten,

Yeah thats a good suggestion. Also can you tell me how to remove the
C:\RSA75Workspace\workspace/ blah blah to some thing relative to workspace??
so that the POM is portable to another workspace.

Thanks
Syed...

--
View this message in context: http://maven.40175.n5.nabble.com/eclipse-plugin-has-a-POM-of-its-own-tp5535417p5537029.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Antwort: eclipse plugin has a POM of its own

Posted by Thorsten Heit <th...@vkb.de>.
Hi,

> <build>
> 
> 
> 
<sourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src</sourceDirectory>
> 
> <scriptSourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src\main
> \scripts</scriptSourceDirectory>
> 
> <testSourceDirectory>C:\RSA75Workspace\workspace\finAppWeb\src\test
> \java</testSourceDirectory>
> 
> <outputDirectory>C:\RSA75Workspace\workspace\finAppWeb\target\build
> \classes</outputDirectory>
> 
> <testOutputDirectory>C:\RSA75Workspace\workspace\finAppWeb\target\test-
> classes</testOutputDirectory>

*snip*

Just a side note:
I have made the experience that backslashes in files are treated by Java 
more or less often as a quoting character. To prevent strange errors I'd 
recommend either using forward slashes ('/'; should also work as directory 
separator under Java in Windows environments), or a double backslash '\\'.


HTH

Thorsten