Maven Repository-Based JBoss IntelliJ Investigation Environment: Difference between revisions
No edit summary |
|||
(23 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[ | * [[WildFly Source#Subjects|WildFly Source]] | ||
* [[Maven]] | * [[Maven]] | ||
* [[IntelliJ]] | * [[IntelliJ]] | ||
=Overview= | |||
This article describes the procedure to create an IntelliJ project whose modules contain JBoss EAP source code and that can later be imported within other IntelliJ projects to help with debugging code running within JBoss - including the JBoss parts. | |||
Unzip the Maven repository into <tt>~/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository</tt>. | =Create Reference Modules= | ||
Get the Maven repository corresponding to the JBoss instance you intent do debug. | |||
<font color=red>Come up with a solution when the target version is 6.4.4, for example, but the Maven repository corresponds to 6.4.0. The repository won't probably capture subsequent patches.</font> | |||
Unzip the Maven repository into <tt>~/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository</tt>. Alternatively, EAP 6.4.0 gets unzipped into <tt>~/projects/eap6.4/6.4.0/jboss-eap-6.4.0.GA-maven-repository</tt>. | |||
Create an empty IntelliJ project rooted in the Maven repository directory <tt>/Users/ovidiu/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository/maven-repository</tt>. | |||
Use the Project Name "EAP 7.0.0.Beta1 Maven Repository" but restore the project location to "maven-repository", if necessary, | |||
Project format: .idea (directory based). | |||
Add a "More Settings" "Root Module" with the content root directory pointing to the same directory as the project. | |||
==Add a Module per Subsystem== | |||
Add a module. New -> Module -> Java | |||
Name: EAP 7.0 Beta Undertow | |||
Content root: /Users/ovidiu/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository/maven-repository/modules/EAP 7.0 Beta Undertow | |||
Use the same value for module file location. | |||
Open Module Settings -> Dependencies tab. | |||
+ -> Library -> Java -> ... io/undertow/undertow-core/1.3.7-Final-redhat-1/*.jar | |||
Level: Module Library | |||
+ -> the source JAR. | |||
Scope: Provided. | |||
Export: yes. | |||
=Add More Content to a Reference Module= | |||
Open the reference IntelliJ project -> navigate to the module in question -> Dependencies -> + -> Library -> Java | |||
then follow the same procedure as for [[#Create_Reference_Modules|Create Reference Modules]]. | |||
<blockquote style="background-color: Gold; border: solid thin Goldenrod;"> | |||
:<br>It is important to follow the same procedure and be careful to settings (such as Level, etc), otherwise you could end up with broken modules.<br><br> | |||
</blockquote> | |||
You can add new libraries to a Module that is currently open in a different project, but in order to see the changes, you will need to close and re-open the dependent project. | |||
=Import a Module in Your Project= | |||
File -> Project Structure -> Modules -> + -> Import Module. | |||
<font color=red> | |||
Last time it did not work, the library showed red and "broken". I had to move the library to "Global Libraries" ... , and then things seemed to fix. To experiment when I have time. | |||
</font> |
Latest revision as of 04:17, 10 May 2016
Internal
Overview
This article describes the procedure to create an IntelliJ project whose modules contain JBoss EAP source code and that can later be imported within other IntelliJ projects to help with debugging code running within JBoss - including the JBoss parts.
Create Reference Modules
Get the Maven repository corresponding to the JBoss instance you intent do debug.
Come up with a solution when the target version is 6.4.4, for example, but the Maven repository corresponds to 6.4.0. The repository won't probably capture subsequent patches.
Unzip the Maven repository into ~/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository. Alternatively, EAP 6.4.0 gets unzipped into ~/projects/eap6.4/6.4.0/jboss-eap-6.4.0.GA-maven-repository.
Create an empty IntelliJ project rooted in the Maven repository directory /Users/ovidiu/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository/maven-repository.
Use the Project Name "EAP 7.0.0.Beta1 Maven Repository" but restore the project location to "maven-repository", if necessary,
Project format: .idea (directory based).
Add a "More Settings" "Root Module" with the content root directory pointing to the same directory as the project.
Add a Module per Subsystem
Add a module. New -> Module -> Java
Name: EAP 7.0 Beta Undertow
Content root: /Users/ovidiu/projects/eap7/beta/jboss-eap-7.0.0.Beta1-maven-repository/maven-repository/modules/EAP 7.0 Beta Undertow
Use the same value for module file location.
Open Module Settings -> Dependencies tab.
+ -> Library -> Java -> ... io/undertow/undertow-core/1.3.7-Final-redhat-1/*.jar
Level: Module Library
+ -> the source JAR.
Scope: Provided.
Export: yes.
Add More Content to a Reference Module
Open the reference IntelliJ project -> navigate to the module in question -> Dependencies -> + -> Library -> Java
then follow the same procedure as for Create Reference Modules.
It is important to follow the same procedure and be careful to settings (such as Level, etc), otherwise you could end up with broken modules.
You can add new libraries to a Module that is currently open in a different project, but in order to see the changes, you will need to close and re-open the dependent project.
Import a Module in Your Project
File -> Project Structure -> Modules -> + -> Import Module.
Last time it did not work, the library showed red and "broken". I had to move the library to "Global Libraries" ... , and then things seemed to fix. To experiment when I have time.