Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make plugin IDE friendly #74

Open
GoogleCodeExporter opened this issue Aug 14, 2015 · 13 comments
Open

Make plugin IDE friendly #74

GoogleCodeExporter opened this issue Aug 14, 2015 · 13 comments

Comments

@GoogleCodeExporter
Copy link

Hi.

It would be nice to have classes from Deadbolt module (and probably some others 
also) app folder in maven classpath.

It would give much better IDE support with just pom declaration.

Thanks,
Marek

Original issue reported on code.google.com by [email protected] on 24 Apr 2012 at 3:26

@GoogleCodeExporter
Copy link
Author

What does "better IDE support" mean? What IDE? If Eclipse - you mean project 
generated with "play eclipsify" or with M2Eclipse plugin?

I need more details, please.

Original comment by [email protected] on 25 Apr 2012 at 8:42

@GoogleCodeExporter
Copy link
Author

I'm opening pom straight in NetBeans IDE. When i have some library in pom 
(play-sass module for example) it gives me not only code completion but also 
automatically downloads and attaches sources and javadoc.

Original comment by [email protected] on 25 Apr 2012 at 10:38

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 23 Nov 2013 at 8:31

  • Changed title: Make plugin IDE friendly
  • Changed state: Started
  • Added labels: Component-PlayMavenPlugin, Milestone-1.0.0-beta7, Priority-Low, Type-Enhancement, Usability
  • Removed labels: Priority-Medium, Type-Defect

@GoogleCodeExporter
Copy link
Author

New 1.0.0-beta7-SNAPSHOT snapshots of plugin artifacts and 
"play-app-default-parent" deployed.
If you use "play-app-default-parent" just change it's version to 
"1.0.0-beta7-SNAPSHOT". If not - change all plugin artifacts versions to 
"1.0.0-beta7-SNAPSHOT".

Original comment by [email protected] on 23 Nov 2013 at 8:59

@GoogleCodeExporter
Copy link
Author

There are some problems with multimodule projects with inter-module 
dependencies, but they can fixed manually after importing into Eclipse IDE 
(with M2Eclipse plugin).

Original comment by [email protected] on 23 Nov 2013 at 9:09

@GoogleCodeExporter
Copy link
Author

M2Eclipse integration implemented in:

http://code.google.com/p/maven-play-plugin/issues/detail?id=11728
http://code.google.com/p/maven-play-plugin/issues/detail?id=11729
http://code.google.com/p/maven-play-plugin/issues/detail?id=11730
http://code.google.com/p/maven-play-plugin/issues/detail?id=11737
http://code.google.com/p/maven-play-plugin/issues/detail?id=11738

New 1.0.0-beta7-SNAPSHOT deployed.

Original comment by [email protected] on 27 Dec 2013 at 4:18

@GoogleCodeExporter
Copy link
Author

http://code.google.com/p/maven-play-plugin/issues/detail?id=11840 - M2Eclipse 
integration cont. - BuildContext usage added (see 
https://wiki.eclipse.org/M2E_compatible_maven_plugins).

Original comment by [email protected] on 21 Feb 2014 at 10:02

@GoogleCodeExporter
Copy link
Author

http://code.google.com/p/maven-play-plugin/issues/detail?id=11840 - 
play-app-default-parent - "views/**" exclusion added to maven-compiler-plugin's 
configuration.

Original comment by [email protected] on 21 Feb 2014 at 10:05

@GoogleCodeExporter
Copy link
Author

http://code.google.com/p/maven-play-plugin/issues/detail?id=11842 - M2Eclipse 
integration cont. - BuildContext usage added (see 
https://wiki.eclipse.org/M2E_compatible_maven_plugins).

Original comment by [email protected] on 21 Feb 2014 at 10:13

@GoogleCodeExporter
Copy link
Author

New 1.0.0-beta8-SNAPSHOT deployed.

Original comment by [email protected] on 21 Feb 2014 at 10:14

@GoogleCodeExporter
Copy link
Author

Hello,

I hope it's the good place for my questions.

I work with IntelliJ Idea. (so I don't use m2e Eclipse plugin)
For some plugins Idea can't provide code completion because it doesn't know 
their classes. Event if Maven goals like "package" works perfectly.

It seems these plugins have "zip module" dependency, but no jars. So there is 
no entry for them in Maven dependencies for my Idea module.

* http://search.maven.org/#search%7Cga%7C1%7Cplay%20plugin%20pdf
there are pom, module.zip, jar, sources.jar, ...

* http://search.maven.org/#search%7Cga%7C1%7Cplay%20plugin%20deadbolt
no jar, no sources.jar, no javadoc.jar
=> the same for crud and secure

Is it possible to add *.jar artifacts to theses modules ?

Thanks

Original comment by [email protected] on 27 Aug 2014 at 1:51

@GoogleCodeExporter
Copy link
Author

Hi Sebastien

No, this is supposed to work differently.
There are two kinds of modules, with "pom" and "jar" packaging.

Compare these two for example:
http://repo2.maven.org/maven2/com/google/code/maven-play-plugin/org/playframewor
k/modules/testrunner/play-testrunner/1.2.7/
and
http://repo2.maven.org/maven2/com/google/code/maven-play-plugin/org/playframewor
k/modules/crud/play-crud/1.2.7/

Why testrunner has "jar" packaging and three jar files 
("play-testrunner-1.2.7.jar", 
"play-testrunner-1.2.7-javadoc.jar""play-testrunner-1.2.7-sources.jar")? 
Because it has two different source roots:
1. https://github.com/playframework/play1/tree/1.2.7/modules/testrunner/app
and
2. https://github.com/playframework/play1/tree/1.2.7/modules/testrunner/src

The content of "src" directory is compiled and packaged into 
"play-testrunner-1.2.7.jar". This is the case in all modules containing "src" 
directory.

The source files from "app" directory are never packaged into a "jar" file
and in your application they are attached as additional source roots.
When you have java source files extracted to disk and attached to your project,
you don't need and "-sources" or "-javadoc" jars.

Now, what you need to make IntelliJ Idea extract modules and attach their "app" 
folders as source roots in your project properly?
You have to tell it to run two mojos: "play:initialize" and "play:dependencies" 
when importing. "play:initialize" extracts Play! framework and all 
provided-scoped modules in "target/play" directory. "play:dependencies" extract 
all non-provided-scoped modules in "modules" directory.
1. You have to set "Generate source folders" combo value to "Detect 
automatically".
2. You have to select any phase in "Phase to be used for folders update". Why?
Because "play:initialize" mojo is bound to Maven "initialize" phase. This phase 
is before any phase from this combo in Maven lifecycle, so will be run always.
"play:dependencies", on the other hand, is NOT bound to Maven lifecycle. 
Normally you must run it manually, but in IntelliJ Idea you have no possibility 
to order to run it. In all my test projects having non-provided-scoped module 
dependencies I created "autodeps" profile, where "play:dependencies" mojo is 
bound to Maven "validate" phase. This is the first phase in default lifecycle 
("initialize" phase would be good as well, it's second one). When you have this 
mojo in the profile, you have to tell IntelliJ Idea to use this profile (I 
don't remember where, but there is a screen for profiles selection).

That's all. I don't use Idea, but today I've installed it and tested everything 
I wrote above.

I don't know why, but this did not work during import. I had to run 
"Maven/Generate sources and Update Folders". Maybe I did some stupid mistake, 
it should work from the start, IMO.

And one more thing, I unchecked "Exclude build directory 
(%PROJECT_ROOT%/target)" checkbox, because I want to add 
"target/play/modules/{modulename}/app" folders as source roots. I didn't check 
if this is required, but I think it should be.

Tell me if it works for you. I think, I should add wiki page about Idea IDE 
integration. I must a little more with this IDE.

Sorry for my English. Sometimes I have problems with translating all I want to 
say. I hope you understood.


Original comment by [email protected] on 27 Aug 2014 at 6:47

@GoogleCodeExporter
Copy link
Author

Hi,

Thanks for your answer and sorry for my late reply. (the notification was in my 
spam folder ... and I cut off during my holidays ;-) )

Your explanations are clear for me. (I'm not fluent in english too, but it's OK)
After launched "Maven/Generate sources and Update Folders" Intellij Idea 
provides me code completion, and so on.
I don't have any "target/..." subfolders as sources. It's good.
NB: I tested on my current project, not on a new one. So I don't have anything 
to add about import "bug".

For autodeps profile, I already activated it (I read about it somewhere else on 
this site). FYI in Intellij Idea there is a checkbox for each profile you want 
to activate in the Maven view.

If it can help you for a wiki page about Idea IDE integration, to debug the app 
I did the followed steps:
- open "Run / Edit Configurations..."
- add a new "Remote" configuration
- Transport = Socket / Debugger mode = Attach / Host = localhost / Port = 8000
- named it (ex: "debug Play! app")
- start your app (ex: play:run or play:start or play:test)
- run "debug Play! app" (with the debug button, run button is disabled)

Regards

Original comment by [email protected] on 5 Sep 2014 at 7:19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant