I have two projects, having their own modules:
projectA
moduleA1
moduleA2
projectB
moduleB1
moduleB2
I want to edit both projects at the same time with Intellij Idea. They advice to import one project as a module of another. Ok, let projectA be a module of projectB. I'd like to see the structure:
projectA
moduleA1
moduleA2
projectB
moduleB1
moduleB2
But I get
projectA
moduleA1
moduleA2
moduleB1
moduleB2
What am I doing wrong? Is there any capability not to unwrap the current project structure?
Not going into the configurations of the classpath and other variables, just simply the file structure; I had the same problem at first when attempting to re-create your scenario. Though it is a simple "over-looked" setting of the modules.
The overall layout is:
Now when adding another module (in this case "ModuleA3", Intellij will set the default path to: $PROJECT_DIR$/Module3A
Because of this, Intellij is trying to create this module as a sub-module of the "Top-Level Project"; the solution is somewhat simple, change the path to:
$PROJECT_DIR$/ProjectA/Module3A
EDIT: I can now post images so I included my originals for this question; I find them easier to see what is going on.
-Thomas
Related
I come with this odd question, after look on the intelliJ forums I have no results.
I started to work in a project that has multiple gradle modules.
There is one module that has another module referencing it.
Lets say I have ModuleA with all my classes, each class I add on a new package appears also in ModuleB
When I checked on the folders of ModuleB I noticed a weird icon.
Checking the folder (right-click) I can see the option:
Go to Link Target
That basically takes me to ModuleA's folder configuration.
I could find no gradle configuration that makes these references or how to reproduce it.
Any idea how?
These are Symbolic links and are created in Bash. This doesn't have anything to do with gradle.
More info here
I have two gradle project:
projectA
submodule
projectB
submodule
Both submodules have the same name (but other group id). When I try to import both project to same workspace in IDEA, it imports one project correctly (root module + submodule) and only root module of second project. When I try to manually import missing submodule, it don't allow to it. because: "module "submodule" already exists in the project".
Is this a bug in IDEA ?
Is there any way to import this correctly?
I workaround this by change IDEA project name of "submodule" to "A-submodule", but I suppose that it must be a better way to do it.
I built the Drill project according to the wiki specification
but, the project has some errors. Some classes (BigIntVector, BitHolder,BigIntHolder) can't be resolved and the workspace don't really contain these class files. Any suggestions as to what's going on?
These clases are generated during build.
exec/java-exec/target/generated-sources/org/apache/drill/exec/expr/holders/BigIntHolder.java
There is a problem in that the Maven import into eclipse results in target/generated-sources/org being added to the Source Folder build path. I have found that in the two cases, comon and java-exec, if you remove these folders from the source folder build path and add them as target/generated-sources this will help.
This is a workaround, there is obviously a misconfigured pom.xml somewhere.
After a lot of good comment about IDEA, I decided to give it a try. I downloaded the Community Edition and would like to use it for PlayFramework development.
I have followed official documentation and some other information gathered around, but I have not succeeded completely. When using a project with differents (play) modules, the different classes are not found.
For example when using Secure module, IDEA keeps complaining about not finding Secure.class. It has to be a classpath issue. I tried to attach Java source & classes ($PLAY/modules/secure/) in module settings (F4), class is still not found. Did I miss something?
BTW, I have done a play dependencies and play idealize, which seems to add another module Secure into project in IDEA.
Thanks,
The answer is to run the following:
play deps
play idealize
This forces the IDEA .iml project file to be refreshed with the updated class path entries for the new module (in this case Secure).
A issue I came across using IntelliJ and Playframework.
The log4j.properties file or log4j.xml file are not in classpath by default. You have to add the conf as a source folder in module settings.
You need to add the Secure module you have created in IDEA as a dependency to the main application module:
Go to File -> Project Structure
Choose the main module
Choose the Dependencies tab
Click Add -> Module Dependency
Choose the IDEA Module you created for the Play Secure module
Also make sure you have the correct source path selected for the Secure module in IDEA.
I know there are various known issues with the M2eclipse plugin and I guess this is just one of them. Hopefully someone is aware of a solution or workaround.
We have like 30 projects in our workspace but for clarity lets assume there are only 2: A en B.
B includes A as a dependency in the pom.xml of B.
The problem we have is that in eclipse the classes of A can't be found so you get compilation errors. However, if you 'mvn install' A to deploy it in the local repository and the close project A then everything is fine; no compilation errors. So, if A exists in the project M2Eclipse does not seem to be able to correctly set the classpath in eclipse.
To make things stranger, we also have project C that also depends (in exactly the same way as B) on project A but here we have no compilation errors. We can't identify anything meaningful difference between project B or C; as said, they include A in the same manner.
thanks for your help,
Stijn
P.S. I'm using version 0.10.2.20100623 of the plugin
I've experienced this behavior before, and it has occurred for me in the past when I imported or checked out the maven projects separately.
Prerequisite: make sure you have m2extras installed before you check out a multi-module Maven project: update site
First thing to try: right-click each project and choose Maven -> update project configuration. The plugin might be smart enough to detect that it could be building project references between the projects.
Second thing to try (if your 30 projects are all submodules off one root): this would be easiest, because you could use the SCM integration of m2eclipse to do a "Checkout as Maven Project..." on the root pom. M2eclipse would make a project for the superpom and for each submodule, with project references built appropriately.
Third thing to try: I'd try manually creating project references in the project settings of each project to mirror their interdependencies. It'd be a lot of work, and unless you check in your eclipse .project/.settings (eww), it would have to be done individually for each working copy.
RESOLVED
finally, after agonizing hours I found the cause.
I was focussing on the .classpath and the .settings files but the problem was located in the .project file. This file in project A was missing following entry in the tag natures:
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
Adding this resolved the issues.