directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot>
Subject Adding a new profile to the 'project' pom.xml to ease the import of the same project twice in Eclipse
Date Wed, 23 Feb 2011 12:54:37 GMT
Hi Dev,

Eclipse is great but it has one major drawback for me (and others too I believe), that's it's
inability to import the same project twice in the workspace.

Now, by "the same project" I don't mean the exact same project (which would not make much
sense) but I mean the same project but from various SVN branches (e.g. one version from trunk
and another from a branch).

Considering that we're now working in two different places ('trunks' and 'milestones' branches),
I would rather have all the projects in a common workspace than having two workspaces (one
for each branch).

The basic problem is that 'mvn eclipse:eclipse' generates the same project names for both
branches and that Eclipse only allows one project with a given name at a time in the workspace
(and I can understand that).

Recently, while looking at the Maven Eclipse plugin documentation I found out an interesting
configuration option that we could leverage to solve this issue.

I built a specific profile that will be activated if we specify a string we want to be appended
to the name of the project when creating eclipse descriptors using 'mvn eclipse:eclipse[string]'.

Here it is:

> <profile>
> <id>append-to-project-name</id>
> <activation>
> <property>
> <name></name>
> </property>
> </activation>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-eclipse-plugin</artifactId>
> <configuration>
> <projectNameTemplate>[artifactId]-${}</projectNameTemplate>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </profile>

Using this profile it is now possible to import the same project twice (and more) by providing
for example the name of the branch, which will be appended to the name of the project.

I'd like to include this new profile in the 'project' pom to be able to reuse it across all
our projects.


View raw message