Добавить фреймворки в idea
Creates a web resource directory web with index.jsp intended as a starting page of your app and, optionally, a web app deployment descriptor WEB-INF/web.xml .
Creates a Web facet that lets you manage your deployment descriptors, web resource directories and your Java web source roots .
Creates an Exploded WAR artifact configuration.
Makes the Web tool window available.
If you turn on the Web Application option when creating a project or module and specify an application server, IntelliJ IDEA also creates a run/debug configuration for that server.
2 Answers 2
Intellij reacts to changes in your Maven pom.xml file. Maven does not react to changes in your IntelliJ project module settings.
The steps that you should follow here are
- Close IntelliJ
- In a command shell, clone your Github repository.
- Using an editor external to IntelliJ such as VI or Notepad, create a pom.xml in the root directory. Better yet, use a Maven Archetype to generate your pom.xml .
- Now open IntelliJ. Choose File, New, Project From Existing Sources. Navigate to your pom.xml and follow the prompts.
- I recommend checking Search for projects recursively and Import Maven projects automatically.
- Finish the project creation.
- Now, add dependencies to your pom.xml via the dependencies tag. See Maven Dependencies. Intellij will automatically react to dependencies that you add as long as it can see a Maven Repository on your local machine or on your network or on the Internet.
Creating a New Framework
In oder to make a custom framework available and configurable for a project the FrameworkTypeEx class needs to be extended, in this example to make the DemoFramework class.
Joomla!
In this section, configure integration with Joomla! in a project.
Enable Joomla! integration
When the checkbox is selected you can use the specified Joomla! installation via the IntelliJ IDEA interface.
Joomla! installation path
In this field, specify the root folder of the Joomla! installation.
Path to JConfig
In this field, provide the path to the Joomla's configuration.php created during Joomla! installation.
Create a new web application
Click New Project on the Welcome screen or select File | New | Project .
From the Generators list, select Java Enterprise .
Name the new project, select a build tool, a language you want to use, and select the Web application project template.
Select the Create Git repository option to place the new project under version control.
From the JDK list, select the JDK that you want to use in your project.
If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.
If you don't have the necessary JDK on your computer, select Download JDK .
On the next step of the wizard, select the Java EE version to be supported.
From the Dependencies list, select Servlet .
Turn on the Web Application option
Manually add a facet to a module
In the Project tool window Alt+1 , right-click the module to which you want to add a facet, and select Add Framework Support .
Select the necessary framework from the list.
Depending on your choice, you might be prompted to configure additional settings (for example, to configure a library).
Apply the changes and close the dialog.
Add the Web Application option an existing module
This information is valid for projects that are built with the native IntelliJ IDEA builder. If you're using a build tool, such as Maven or Gradle, make all changes using the build file.
In the Project tool window ( Alt+1 ), right-click the necessary module and select Add Framework Support .
In the dialog that opens, select Web Application and select a version of the Servlet specification.
If you want the deployment descriptor web.xml file to be created, select the Create web.xml checkbox.
Manage application artifacts
To manage your artifact configurations, use the Project Structure dialog ( File | Project Structure | Artifacts ).
To deploy your application to a server, you need an application artifact. For Java web applications, IntelliJ IDEA provides the following artifact formats:
Web Application: Exploded. This is a decompressed Web application archive (WAR), a directory structure that is ready for deployment onto a web server.
The following tutorial shows how to support a custom framework type for a project and make this framework type embedded in a project wizard as a UI component. The examples in this tutorial rely heavily on the framework_basics code sample.
Creating Provider for Enabling Framework Support
To make the framework set up available while executing the steps to create a project, the DemoFramework.createProvider() method must be implemented to return an object of type FrameworkSupportInModuleConfigurable , which adds the framework to a module. In this example the framework is added to any ModuleType without checking, which is usually not the case.
@NotNull @Override public FrameworkSupportInModuleProvider createProvider() < return new FrameworkSupportInModuleProvider() < @NotNull @Override public FrameworkTypeEx getFrameworkType() < return DemoFramework.this; >@NotNull @Override public FrameworkSupportInModuleConfigurable createConfigurable( @NotNull FrameworkSupportModel model) < return new FrameworkSupportInModuleConfigurable() < @Override public JComponent createComponent() < return new JCheckBox("SDK Extra Option"); >@Override public void addSupport(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ModifiableModelsProvider provider) < // This is the place to set up a library, generate a specific file, // and actually add framework support to a module. >>; > @Override public boolean isEnabledForModuleType(@NotNull ModuleType type) < return true; >>; >
Manage deployment descriptors, web resource directories, and Java web source roots
You can manage your web app deployment descriptors, web resource directories and Java web source roots in the Project Structure dialog:
From the main menu, select File | Project Structure or press Ctrl+Alt+Shift+S .
In the leftmost pane, select Modules or Facets .
In the pane to the right, select Web or Web () .
On the page that opens in the right-hand part of the dialog:
Deployment Descriptors. Form the list of deployment descriptors for your web app.
Web Resource Directories. Specify the directories that contain your web app resources such as web pages, images, etc.
Source Roots. Select the source roots that contain your web application Java classes (servlets, filters, managed beans, etc.).
Registering Framework
The newly created framework class should be registered as an extension point by adding com.intellij.framework.type extension in plugin.xml configuration file:
Disable framework auto-detection
By default, auto-detection is enabled for all the supported frameworks. You can disable framework auto-detection completely, or exclude individual frameworks from auto-detection.
From the main menu, select File | Project Structure ( Ctrl+Alt+Shift+S ) and select Facets .
Select Detection and click Alt+Insert .
From the Framework to Exclude list, select the necessary option.
You can disable auto-detection of a specific framework only in one directory or in the whole project. The list also allows you to disable auto-detection of all frameworks in a specific directory.
If you want to disable auto-detection of all frameworks in the whole project, deselect the Enable framework detection checkbox.
To re-enable auto-detection everywhere, select the Enable framework detection checkbox and remove all entries from the Exclude from detection list.
On this page, set up PHP frameworks integration with IntelliJ IDEA in the current project. The settings for each framework are shown in a separate area. A framework-specific area is shown only when the corresponding plugin ( Drupal Support , Joomla! Support , or WordPress Support ) is installed and enabled on the Plugins page as described in Install plugins.
WordPress
To use WordPress in the command line mode, configure it as a command line tool in Command Line Tool Support .
In this area, configure integration with the WordPress Content Management System in the current project to work with the system through the IntelliJ IDEA user interface.
Enable WordPress Integration
When the checkbox is selected you can use the specified WordPress installation via the IntelliJ IDEA interface.
WordPress Installation Path
In this field, specify the folder where WordPress is installed. This folder should contain the wp-admin and wp-includes subdirectories.
I found a pretty old post with this question but unfortunately he didn't get any help. I hope someone can assist me.
I created a repo at GitHub. After cloning it to my computer I tried to add the following framework support: Maven, JSF, EJB, CDI, etc. I know I could add the files manually. But, I want to use what the IDE has to offer.
However, the only framework showing up is SQL, which is different from this post from stackoverflow and from their documentation. Has anyone had this same problem and got it working?
There's a difference between whether you're importing a project based on a Maven pom.xml versus creating a new project and letting Intellij guess at frameworks by scanning your code base. What are the steps that you have taken to create this project? What is the Github link? Please share the pom.xml
You're doing the wrong thing. Start with Maven, and open the pom. If you start with IntelliJ your project is only useful to you -- ever.
@Kirby: as it didnt work I didnt push my branches back to GitHub, but I firstly cloned the repo and added a new Maven Project from it by adding the pom.xml file and setting the project as a Maven one. Then I tried to add frameworks from the IDE but it only showed SQL.
@EngineerDollery: that's basically what I've done but instead of adding dependencies to the pom.xml file I tried to add frameworks directly in the IDE hoping that it would work somehow on my pom.xml file too.
Compile and Run the Plugin
See Code Samples on how to set up and run the plugin.
Extra option for configuring the newly created Demo custom framework should be available in the Project Wizard:
This information is valid for projects that are built with the native IntelliJ IDEA builder. If you're using a build tool, such as Maven or Gradle, make all changes using the build file.
For developing framework-specific applications, IntelliJ IDEA features facets. Facets contain libraries, dependencies, and technologies, and they provide you with additional UI elements for configuring framework-specific settings.
Note that not all facets are available out of the box. To be able to use some of them, you need to install a plugin for the necessary framework first. Refer to JetBrains Plugin Repository for more information on existing plugins.
IntelliJ IDEA can identify a file or a directory that is typical for a certain framework, and add the necessary facet for you. Once the facet is detected and added, IntelliJ IDEA will inform you about the missing configuration and will suggest the necessary actions.
If a facet is not detected automatically, you can add it manually. You can add more than one facet to a module.
Some frameworks are available only in IntelliJ IDEA Ultimate. Refer to comparison matrix to make sure your version of IntelliJ IDEA supports the necessary frameworks.
You can find all facets that are configured for modules in your project in the Project Structure dialog: from the main menu, select File | Project Structure ( Ctrl+Alt+Shift+S ) and select Modules .
If you use a build tool in your project, such as Maven or Gradle, make all changes using the build file.
Setting up Mandatory Attributes
The framework component should have a unique name passed as a string literal to the constructor. It is best if this is the FQN name of the class:
The Presentable name and icon define the appearance of visual components related to the framework:
Drupal
In this section, configure integration with Drupal in a project.
Enable Drupal integration
When the checkbox is selected you can use the specified Drupal installation via the IntelliJ IDEA interface.
Drupal installation path
In this field, specify the root folder of the Drupal installation.
Set up PHP | Include paths
Select this checkbox to have Drupal include paths automatically configured for the project.
After you leave the dialog, the following paths will be added to the Include Paths list on the PHP page: /includes , /modules , and /sites/all/modules
Clear the checkbox to configure the include paths manually.
From this list, choose the version of Drupal to use, the supported versions are 6, 7, and 8.
Читайте также: