You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Baard Johansen (JIRA)" <ji...@codehaus.org> on 2009/07/09 17:23:22 UTC

[jira] Created: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Using -Declipse.projectNameTemplate is broken on multi module projects
----------------------------------------------------------------------

                 Key: MECLIPSE-586
                 URL: http://jira.codehaus.org/browse/MECLIPSE-586
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
    Affects Versions: 2.7, 2.6
         Environment: Maven version: 2.0.9
Java version: 1.6.0_10-rc
OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
            Reporter: Baard Johansen


In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.

Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:

moduleA/.project
<projectDescription>
  <name>trunk-moduleA</name>
  <projects>
    <project>moduleB</project>
  </projects>
  [..]
</projectDescription>

moduleA/.classpath
<classpath>
  [..]
  <classpathentry kind="src" path="/moduleA"/>
</classpath>

moduleB/.project
<projectDescription>
  <name>trunk-moduleB</name>
  [..]
</projectDescription>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Wren Weburg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212331#action_212331 ] 

Wren Weburg commented on MECLIPSE-586:
--------------------------------------

I'm also having problems with getting the child projects to reference the correct project name when the eclipse project files are generated. The unchanged artifactId is referenced, not the custom artifact id where we like to have groupId and version added. It would be great if this could be fixed so that my team can set up many branches of the same project in the same Eclipse workspace without all the hassle of manually fixing the dependencies.

For now our manual fix is to change two things with the sub (child) project's files:

1) In the .project file, update the listed project name from "core" to the proper project, e.g.:
  <projects>
    <project>com.mycompany.core-1.0</project>
  </projects>

2) In the .classpath file, make similar change, changing core as per below:
<classpathentry kind="src" path="/com.mycompany.core-1.0"/>

It is hard to write a programmatic fix for this because it would basically have to replicate everything the eclipse plugin does by reading the POM, and of course it's better to fix it at the root cause. :-)

> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleA"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Robert Watkins (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=279275#comment-279275 ] 

Robert Watkins commented on MECLIPSE-586:
-----------------------------------------

Just wanted to add:

* This is occurring with 2.8 and current (mid-September 2011) 2.9-SNAPSHOT builds
* The workaround (changing the configuration of the plugin) does work.


> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleB"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Vadim Strizhevsky (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=269739#action_269739 ] 

Vadim Strizhevsky commented on MECLIPSE-586:
--------------------------------------------

Any progress/update on this issue? Is anyone implemented a patch that makes the plugin do the right thing here?

> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleA"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Marcin Gryszko (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=203378#action_203378 ] 

Marcin Gryszko commented on MECLIPSE-586:
-----------------------------------------

I tried this workaround but it doesn't work for me. Tried to put <projectNameTemplate> element in the parent POM, parent and child and child only and project names in .classpath are still generated without the version number.

> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleA"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte updated MECLIPSE-586:
------------------------------------

    Description: 
In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.

Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:

moduleA/.project
<projectDescription>
  <name>trunk-moduleA</name>
  <projects>
    <project>moduleB</project>
  </projects>
  [..]
</projectDescription>

moduleA/.classpath
<classpath>
  [..]
  <classpathentry kind="src" path="/moduleB"/>
</classpath>

moduleB/.project
<projectDescription>
  <name>trunk-moduleB</name>
  [..]
</projectDescription>

  was:
In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.

Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:

moduleA/.project
<projectDescription>
  <name>trunk-moduleA</name>
  <projects>
    <project>moduleB</project>
  </projects>
  [..]
</projectDescription>

moduleA/.classpath
<classpath>
  [..]
  <classpathentry kind="src" path="/moduleA"/>
</classpath>

moduleB/.project
<projectDescription>
  <name>trunk-moduleB</name>
  [..]
</projectDescription>


Adjusting description according to first comment.

> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleB"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Baard Johansen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183081#action_183081 ] 

Baard Johansen commented on MECLIPSE-586:
-----------------------------------------

Oops, the classpathentry in moduleA/.classpath was wrong. Should have been "/moduleB".

> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleA"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] (MECLIPSE-586) Using -Declipse.projectNameTemplate is broken on multi module projects

Posted by "Max Bowsher (JIRA)" <ji...@codehaus.org>.
    [ https://jira.codehaus.org/browse/MECLIPSE-586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=294314#comment-294314 ] 

Max Bowsher commented on MECLIPSE-586:
--------------------------------------

This regression was introduced in r727620.

To fix, just delete the code which does the wrong thing from EclipsePlugin.java:

        MavenProject reactorProject = getReactorProject( artifact );
        if ( reactorProject != null )
        {
            return IdeUtils.getProjectName( getProjectNameTemplateForMavenProject( reactorProject ), artifact );
        }

                
> Using -Declipse.projectNameTemplate is broken on multi module projects
> ----------------------------------------------------------------------
>
>                 Key: MECLIPSE-586
>                 URL: https://jira.codehaus.org/browse/MECLIPSE-586
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Core : .project, Core : Dependencies resolution and build path (.classpath), Core : Multi-projects
>    Affects Versions: 2.6, 2.7
>         Environment: Maven version: 2.0.9
> Java version: 1.6.0_10-rc
> OS name: "linux" version: "2.6.27-14-generic" arch: "amd64" Family: "unix"
>            Reporter: Baard Johansen
>
> In version 2.5.1 when specifying projectNameTemplate on the commandline, the .project file and references are generated correcly. In 2.6 and 2.7 the project has the correct name, but referenced projects is not using the specified pattern. This renderes the .project-file and .classpath useless.
> Example (using mvn eclipse:eclipse -Declipse.projectNameTemplate=trunk-[artifactId]) where moduleA depends on moduleB:
> moduleA/.project
> <projectDescription>
>   <name>trunk-moduleA</name>
>   <projects>
>     <project>moduleB</project>
>   </projects>
>   [..]
> </projectDescription>
> moduleA/.classpath
> <classpath>
>   [..]
>   <classpathentry kind="src" path="/moduleB"/>
> </classpath>
> moduleB/.project
> <projectDescription>
>   <name>trunk-moduleB</name>
>   [..]
> </projectDescription>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira