shdqcdsn / counterclockwise

Automatically exported from code.google.com/p/counterclockwise
0 stars 0 forks source link

Add a trigger to explicitly turn leiningen nature off - was: Confusion between Maven and Leiningen build setup? #663

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a few projects that are created and managed with Maven (this is a 
requirement for Clojure contrib projects, plus it is also useful for polyglot 
Clojure+Java projects). It seems that CCW automatically adds the Leiningen 
nature however which is not intended.

What steps will reproduce the problem?

It appears this happens whenever a project has both project.clj and pom.xml 
with Maven support enabled.

As far as I can see, CCW is automatically adding the "ccw.leiningen.builder" to 
the .project file

What is the expected output? What do you see instead?

I'd expect Leiningen not to be used when Maven is being used to manage the 
project instead. Suggestion: automatic enablement of Leiningen support should 
be turned off if Maven is being used.

What version of the product are you using? On what operating system?

Windews 7, Eclipse Luna, latest CCW release 0.28.1.STABLE001

Please provide any additional information below.

Original issue reported on code.google.com by mike.r.anderson.13@gmail.com on 20 Oct 2014 at 8:34

GoogleCodeExporter commented 9 years ago
Hello Mike, 

Indeed, Leiningen support in the current version is automatically added under 
the following conditions:
- the project has a project.clj file at its root

I have made changes, soon to be released, to this, because other people were 
also harmed by the current behavior. On the master branch the conditions are 
now more restrictive:
- the project has project.clj, of course
- there is currently no Java (JDT) nature

So if a project has a pre-existing maven nature, which also implies a JDT 
nature, Leiningen nature will not be triggered anymore, and thus the java build 
path will not be reset.

Still, there's the case for projects just cloned from github, and having both a 
pom.xml and a project.clj file.
For those, it will depend on how one imports them: if the project is imported 
as a "generic project", then the Leiningen nature addition will be triggered.
However, if the project is imported via the maven importer, then maven/JDT 
support will be created first, and I expect leiningen nature to not be 
triggered, then.

Does it seem ok, or can you find holes in the reasoning?

Original comment by laurent....@gmail.com on 20 Oct 2014 at 8:46

GoogleCodeExporter commented 9 years ago
Hi Laurent, That reasoning sounds sound. Apologies if I have been repeating a 
previously known issue.

Perhaps it would be good to also have some feature to explicitly turn on / off 
the Leiningen nature? That would be useful for the project import case in the 
(quite likely?) attempt that a new user does the import using the wrong method.

Original comment by mike.r.anderson.13@gmail.com on 20 Oct 2014 at 8:51

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 20 Oct 2014 at 8:58

GoogleCodeExporter commented 9 years ago
Please do not apologize, feedback is and will always be welcome ! Nevermind if 
there are some duplicates some times. This would rather denote that the problem 
has been there for too long, so I may argue it's even good to help me 
prioritize stuff :-) !

You're right, there's no feature for turning leiningen nature off. This would 
help. It would just remove the leiningen nature, not the java nature, thus it 
would not enter in some kind of loop (the java nature would prevent the 
leiningen nature to be automatically re-added).
I will change the summary of the issue to reflect this new goal.

Original comment by laurent....@gmail.com on 20 Oct 2014 at 9:03

GoogleCodeExporter commented 9 years ago

Original comment by laurent....@gmail.com on 20 Oct 2014 at 10:39