IDEA导入Web项目
四、Modules设置
2、添加Dependencies:Modules>Project(项目名)>Dependencies,可以看到之前添加的lib。除此之外,我们还需要添加一个tomcat的lib。点击右边的小加号,选中**2 library>Application Server Libraries>(你已安装的tomcat的lib)。添加完以后记得将checkbox选中(**配置完后记得Apply**)
如果看到Output中的项目里面没有lib包的,这时候回过头去看下怎么加的lib包。
添加成功的话在右侧会出现项目(Modules)的lib,双击lib即可将其加入。
【重要】 如果最后一步的lib包没加进去的话,项目是没办法跑起来的,会报Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]的错误
—————————————————————————————————————————————————————————————————————————————————
(将本地项目上传到git上(简单方法):码云上新创建一个项目,clone下来,复制其中的(隐藏)文件夹.git,到本地项目中,此时就可以直接使用IDEA上传项目到码云中)
git功能扩展:可在项目中的.gitignore中添加过滤文件或文件夹
1、配置语法:
以斜杠“/”开头表示目录;
以星号“*”通配多个字符;
以问号“?”通配单个字符
以方括号“[]”包含单个字符的匹配列表;
以叹号“!”表示不忽略(跟踪)匹配到的文件或目录;
此外,git 对于 .ignore 配置文件是按行从上到下进行规则匹配的,意味着如果前面的规则匹配的范围更大,则后面的规则将不会生效;
2、示例:
(1)规则:fd1/*
说明:忽略目录 fd1 下的全部内容;注意,不管是根目录下的 /fd1/ 目录,还是某个子目录 /child/fd1/ 目录,都会被忽略;
(2)规则:/fd1/*
说明:忽略根目录下的 /fd1/ 目录的全部内容;
(3)规则:
/*
!.gitignore
!/fw/bin/
!/fw/sf/
说明:忽略全部内容,但是不忽略 .gitignore 文件、根目录下的 /fw/bin/ 和 /fw/sf/ 目录;
—————————————————————————————————————————————————————————————————————————————————
IDEA启动报错Plugin Error:
Problems found loading plugins: Plugin "Persistence Frameworks Support" was not loaded: required plugin "Database Tools and SQL" is disabled. Plugin "GlassFish Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "JBoss Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "JSR45 Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "Jetty Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "Resin Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "Tomcat and TomEE Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "CloudBees integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is disabled. Plugin "Geronimo Integration" was not loaded: required plugin "Java EE: EJB, JPA, Servlets" is dis... (show balloon)
找到IDEA配置文件下的disabled_plugins.txt文件删除即可(文件位置在C盘User/用户目录下的账户目录里.IntelliJIdea2017.2中)