| |
| <!DOCTYPE HTML> |
| <html lang="" > |
| <head> |
| <title>IDE Integration ยท ActiveMQ Artemis Documentation</title> |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
| <meta name="description" content=""> |
| <meta name="generator" content="GitBook 3.1.1"> |
| |
| |
| |
| |
| <link rel="stylesheet" href="gitbook/style.css"> |
| |
| |
| |
| |
| <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css"> |
| |
| |
| |
| <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css"> |
| |
| |
| |
| <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <meta name="HandheldFriendly" content="true"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> |
| <meta name="apple-mobile-web-app-capable" content="yes"> |
| <meta name="apple-mobile-web-app-status-bar-style" content="black"> |
| <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png"> |
| <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon"> |
| |
| |
| <link rel="next" href="building.html" /> |
| |
| |
| <link rel="prev" href="code.html" /> |
| |
| |
| </head> |
| <body> |
| |
| <div class="book"> |
| <div class="book-summary"> |
| |
| |
| <div id="book-search-input" role="search"> |
| <input type="text" placeholder="Type to search" /> |
| </div> |
| |
| |
| <nav role="navigation"> |
| |
| |
| |
| <ul class="summary"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <li class="chapter " data-level="1.1" data-path="./"> |
| |
| <a href="./"> |
| |
| |
| Introduction |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.2" data-path="notice.html"> |
| |
| <a href="notice.html"> |
| |
| |
| Legal Notice |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.3" data-path="code.html"> |
| |
| <a href="code.html"> |
| |
| |
| Working with the Code |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter active" data-level="1.4" data-path="ide.html"> |
| |
| <a href="ide.html"> |
| |
| |
| IDE Integration |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.5" data-path="building.html"> |
| |
| <a href="building.html"> |
| |
| |
| Building |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.6" data-path="tests.html"> |
| |
| <a href="tests.html"> |
| |
| |
| Tests |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.7" data-path="formatting.html"> |
| |
| <a href="formatting.html"> |
| |
| |
| Code Formatting |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.8" data-path="validating-releases.html"> |
| |
| <a href="validating-releases.html"> |
| |
| |
| Validating releases |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.9" data-path="maintainers.html"> |
| |
| <a href="maintainers.html"> |
| |
| |
| Notes for Maintainers |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| <li class="chapter " data-level="1.10" data-path="history.html"> |
| |
| <a href="history.html"> |
| |
| |
| History |
| |
| </a> |
| |
| |
| |
| </li> |
| |
| |
| |
| |
| <li class="divider"></li> |
| |
| <li> |
| <a href="https://www.gitbook.com" target="blank" class="gitbook-link"> |
| Published with GitBook |
| </a> |
| </li> |
| </ul> |
| |
| |
| </nav> |
| |
| |
| </div> |
| |
| <div class="book-body"> |
| |
| <div class="body-inner"> |
| |
| |
| |
| <div class="book-header" role="navigation"> |
| |
| |
| <!-- Title --> |
| <h1> |
| <i class="fa fa-circle-o-notch fa-spin"></i> |
| <a href="." >IDE Integration</a> |
| </h1> |
| </div> |
| |
| |
| |
| |
| <div class="page-wrapper" tabindex="-1" role="main"> |
| <div class="page-inner"> |
| |
| <div id="book-search-results"> |
| <div class="search-noresults"> |
| |
| <section class="normal markdown-section"> |
| |
| <h1 id="ide-integration">IDE Integration</h1> |
| <p>There a few files useful for IDE integration under ./etc/ide-settings on a checked out folder. This folder is not part of the source distribution, but it can be easily obtained:</p> |
| <ul> |
| <li><a href="https://github.com/apache/activemq-artemis/tree/master/etc/ide-settings" target="_blank">https://github.com/apache/activemq-artemis/tree/master/etc/ide-settings</a></li> |
| </ul> |
| <h2 id="intellij-idea">IntelliJ IDEA</h2> |
| <h3 id="importing-the-project">Importing the Project</h3> |
| <p>The following steps show how to import ActiveMQ Artemis source into IntelliJ IDEA and setup the correct maven profile to allow |
| running of JUnit tests from within the IDE. (Steps are based on version: 13.1.4)</p> |
| <ul> |
| <li>File --> Import Project --> Select the root directory of the ActiveMQ Artemis source folder. --> Click OK</li> |
| </ul> |
| <p>This should open the import project wizard. From here:</p> |
| <ul> |
| <li>Select "Import from existing model" toggle box, then select Maven from the list box below. Click Next.</li> |
| <li>Leave the defaults set on this page and click next.</li> |
| <li>On the "Select profiles page", select the checkbox next to "dev" and click next.</li> |
| <li>From here the default settings should suffice. Continue through the wizard, clicking next until the wizard is complete.</li> |
| </ul> |
| <p>Once the project has been imported and IDEA has caught up importing all the relevant dependencies, you should be able to |
| run JUnit tests from with the IDE. Select any test class in the tests -> integration tests folder. Right click on the |
| class in the project tab and click "Run <classname>". If the "Run <classname>" option is present then you're all set to go.</classname></classname></p> |
| <h3 id="note-about-ibm-jdk-on-idea">Note about IBM JDK on Idea</h3> |
| <p>If you are running IBM JDK it may be a little tricky to get it working.</p> |
| <p>After you add the JDK to the IDE, add also the vm.jar specific to your platform under that jdk.</p> |
| <pre><code>(e.g: JAVA_HOME/jre/lib/amd64/default/jclSC180/vm.jar |
| </code></pre><p>There's a <a href="http://stackoverflow.com/questions/27906481/can-intellij-14-be-used-to-work-with-ibm-jdk-1-7/32852361#32852361" target="_blank">SOF Question</a> about this that could be useful in case you are running into this issue.</p> |
| <h3 id="style-templates-and-inspection-settings-for-idea">Style Templates and Inspection Settings for Idea</h3> |
| <p>We have shared the style templates that are good for this project. If you want to apply them use these steps:</p> |
| <ul> |
| <li>File->Import Settings</li> |
| <li>Select the file under ./artemis-cloned-folder/etc/ide-settings/idea/IDEA-style.jar</li> |
| <li>Select both Code Style Templates and File templates (it's the default option)</li> |
| <li>Select OK and restart Idea</li> |
| </ul> |
| <p>Alternatively you can copy artemis-codestyle.xml under your home settings at <code>IntelliJIdea15/codestyles</code>.</p> |
| <h4 id="to-import-inspection-settings">To import inspection settings:</h4> |
| <ul> |
| <li>File->Settings->Editor->Inspections->Manage->Import</li> |
| <li>Select the file ./artemis-cloned-folder/etc/ide-settings/idea/artemis-inspections.xml</li> |
| <li>Select OK</li> |
| </ul> |
| <h3 id="issue-my-junit-tests-are-not-runnable-with-in-the-ide">Issue: My JUnit tests are not runnable with in the IDE.</h3> |
| <p>If the "Run <classname>" or "Run all tests" option is not present. It is likely that the default profile has not been |
| imported properly. To (re)import the "tests" Maven profile in an existing project.</classname></p> |
| <ul> |
| <li>Open the Maven Projects Tool Window: View -> Tool Windows -> Maven Projects</li> |
| <li>Select the "profiles" drop down</li> |
| <li>Unselect then reselect the checkbox next to "tests".</li> |
| <li>Click on the "Reimport all maven projects" button in the top left hand corner of the window. (It looks like a circular |
| blue arrow.</li> |
| <li>Wait for IDEA to reload and try running a JUnit test again. The option to run should now be present.</li> |
| </ul> |
| <h2 id="eclipse">Eclipse</h2> |
| <p>We recommend using Eclipse Kepler (4.3), due to the built-in support for Maven and Git. Note that there are still some |
| Maven plugins used by sub-projects (e.g. documentation) which are not supported even in Eclipse Kepler (4.3).</p> |
| <p>Eclipse <a href="http://eclipse.org/m2e/" target="_blank">m2e</a> is already included in "Eclipse IDE for Java Developers", or it can be installed |
| from <a href="http://download.eclipse.org/releases/kepler" target="_blank">Eclipse Kepler release repository</a>.</p> |
| <h3 id="git-setup">Git setup</h3> |
| <p>It is strongly recommended to turn off the auto-updating of .gitignore files by the Git Team extension. Otherwise, it |
| generates new .gitignore files in many directories that are not needed due to the top level .gitignore file. To turn |
| it off, go to Preferences->Team->Git->Projects and deselect the "Automatically ignore derived resources" checkbox.</p> |
| <h3 id="schema-setup">Schema setup</h3> |
| <p>For proper schema validation you can add the Artemis schemas to your Eclipse XML Catalog</p> |
| <ul> |
| <li>Open: Window -> Preferences -> XML -> XML Catalog</li> |
| <li>Select Add -> Workspace -> Navigate to artemis-server and select src/main/resources/schema/artemis-server.xsd -> click OK</li> |
| <li>Repeat the above steps and add src/main/resources/schema/artemis-configuration.xsd</li> |
| </ul> |
| <h3 id="checkstyle-setup">Checkstyle setup</h3> |
| <p>You can import the Artemis Checkstyle template into eclipse to do Checkstyle validation. As a prerequisite you need to make sure the Checkstyle plugin is installed into Eclipse which you can get form the Eclipse Marketplace. You also will need to configure Sevntu-Checkstyle. See <a href="http://sevntu-checkstyle.github.io/sevntu.checkstyle/" target="_blank">http://sevntu-checkstyle.github.io/sevntu.checkstyle/</a> for instructions. Then to configure the template:</p> |
| <ul> |
| <li>Open: Window -> Preferences -> Checkstyle</li> |
| <li>Select New -> "Project Relative Configuration" in the "Type" dropdown</li> |
| <li>Give the configuration a name and under location put "/artemis-pom/etc/checkstyle.xml" then hit ok</li> |
| <li>You should now see your new configuration in the list of Checkstyle profiles. You can select the new configuration as the default if you want.</li> |
| </ul> |
| <h3 id="annotation-pre-processing">Annotation Pre-Processing</h3> |
| <p>ActiveMQ Artemis uses <a href="https://community.jboss.org/wiki/JBossLoggingTooling" target="_blank">JBoss Logging</a> and that requires source |
| code generation from Java annotations. In order for it to 'just work' in Eclipse you need to install the |
| <em>Maven Integration for Eclipse JDT Annotation Processor Toolkit</em> <a href="https://github.com/jbosstools/m2e-apt" target="_blank">m2e-apt</a>. See |
| this <a href="https://community.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out" target="_blank">JBoss blog post</a> |
| for details.</p> |
| <h3 id="running-tests-from-eclipse">Running tests from Eclipse</h3> |
| <p>Setting up annotation pre-processing in the above section is all you need to run tests in the "unit-tests" project as that will properly add the generated logger to the source. However, one more step is needed to run tests in other projects such as "performance-tests" or "integration-tests" that have a dependency on "unit-tests". Currently m2eclipse does not properly link the generated source annotations folder from "unit-tests" which causes the logger that is generated to not be available. To simplest way to fix this is to manually add a project dependency on "unit-tests" to each of the projects where you want to run a test class from:</p> |
| <ul> |
| <li>Right click on the test project (i.e. integration-tests): Properties -> Java Build Path -> Projects -> Add</li> |
| <li>Select the "unit-tests" project and click Ok</li> |
| </ul> |
| <p>You should now be able to run tests assuming that the annotation pre-processing was set up properly in the previous step.</p> |
| <h3 id="m2e-connector-for-javacc-maven-plugin">M2E Connector for Javacc-Maven-Plugin</h3> |
| <p>Eclipse Indigo (3.7) has out-of-the-box support for it.</p> |
| <p>As of this writing, Eclipse Kepler (4.3) still lacks support for Maven's javacc plugin. The available <a href="https://github.com/objectledge/maven-extensions" target="_blank">m2e connector for |
| javacc-maven-plugin</a> requires a downgrade of Maven components to be |
| installed. manual installation instructions (as of this writing you need to use the development update site). See |
| <a href="http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02725.html" target="_blank">this post</a> for how to do this with Eclipse Juno (4.2).</p> |
| <p>The current recommended solution for Eclipse Kepler is to mark <code>javacc-maven-plugin</code> as ignored by Eclipse, run Maven |
| from the command line and then modify the project <code>activemq-core-client</code> adding the folder |
| <code>target/generated-sources/javacc</code> to its build path.</p> |
| <h3 id="use-project-working-sets">Use <em>Project Working Sets</em></h3> |
| <p>Importing all ActiveMQ Artemis subprojects will create <em>too many</em> projects in Eclipse, cluttering your <em>Package Explorer</em> |
| and <em>Project Explorer</em> views. One way to address that is to use |
| <a href="http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcworkset.htm" target="_blank">Eclipse's Working Sets</a> |
| feature. A good introduction to it can be found at a |
| <a href="http://eclipse.dzone.com/articles/categorise-projects-package" target="_blank">Dzone article on Eclipse Working Sets</a>.</p> |
| |
| |
| </section> |
| |
| </div> |
| <div class="search-results"> |
| <div class="has-results"> |
| |
| <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1> |
| <ul class="search-results-list"></ul> |
| |
| </div> |
| <div class="no-results"> |
| |
| <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1> |
| |
| </div> |
| </div> |
| </div> |
| |
| </div> |
| </div> |
| |
| </div> |
| |
| |
| |
| <a href="code.html" class="navigation navigation-prev " aria-label="Previous page: Working with the Code"> |
| <i class="fa fa-angle-left"></i> |
| </a> |
| |
| |
| <a href="building.html" class="navigation navigation-next " aria-label="Next page: Building"> |
| <i class="fa fa-angle-right"></i> |
| </a> |
| |
| |
| |
| </div> |
| |
| <script> |
| var gitbook = gitbook || []; |
| gitbook.push(function() { |
| gitbook.page.hasChanged({"page":{"title":"IDE Integration","level":"1.4","depth":1,"next":{"title":"Building","level":"1.5","depth":1,"path":"building.md","ref":"building.md","articles":[]},"previous":{"title":"Working with the Code","level":"1.3","depth":1,"path":"code.md","ref":"code.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"apache/activemq-artemis","theme":"default","githubHost":"https://github.com/","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ActiveMQ Artemis Documentation","links":{"home":"http://activemq.apache.org/","issues":"http://activemq.apache.org/","contribute":"http://activemq.apache.org/contributing.html"},"gitbook":"3.x.x","description":"ActiveMQ Artemis Hacking Guide"},"file":{"path":"ide.md","mtime":"2016-11-02T19:03:35.000Z","type":"markdown"},"gitbook":{"version":"3.1.1","time":"2016-11-03T21:07:00.277Z"},"basePath":".","book":{"language":""}}); |
| }); |
| </script> |
| </div> |
| |
| |
| <script src="gitbook/gitbook.js"></script> |
| <script src="gitbook/theme.js"></script> |
| |
| |
| <script src="gitbook/gitbook-plugin-search/search-engine.js"></script> |
| |
| |
| |
| <script src="gitbook/gitbook-plugin-search/search.js"></script> |
| |
| |
| |
| <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script> |
| |
| |
| |
| <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script> |
| |
| |
| |
| <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script> |
| |
| |
| |
| <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script> |
| |
| |
| |
| </body> |
| </html> |
| |