Dependencies declared in your project's pom.xml file often have their own dependencies. The main dependencies are called direct dependencies. And the sub dependencies on which the direct dependencies relied on are called transitive dependencies. eg:
有时候导入一些开源工程(maven结构的),在eclipse中(装了插件m2eclipse后的)该工程前面会有一个小的红色感叹号,但点开工程后没有发现有打小红叉的内容,这种情况其实大部分是jar包依赖出来问题造成编译不能通过,如果有耐性可以在src里挨个点击代码打开,运气好的话就会发现有报错内容(import 包名 not resloved),找到对应的jar包在maven dependencies下点击相关jar包发现无法打开(正常加载的jar是可以展开目录结构的).如果怕查找src麻烦,
我们在做maven项目时,有时项目会显示红叉,但是项目本身并没有错误,如何去掉呢? 下面是我的解决方法 1.点击项目再右键,在搜索框中输入facets 2.把Dynamic Web Module的版本改为2.5,如果你的版本显示更高的话 3.如果Dynamic Web Module的版本已经是2.5了,那么修改java的版本为1.6或更高,默认maven采用的是自带的jdk配置版本,自带的是jdk1.5的 到这里基本都可以解决红叉的问题了,终于项目看起来没那么别扭了.
1.建立好之后就会发现项目有红叉. 这时发现查查在main处,打开项目>属性>Java Build Path>source,发现里边有红叉(如下图),这是由于我们的src/main下没有建立对应的编译路径main/java和test/java造成的,故添加这两个编译文件夹. 添加好编译文件夹之后,发现红叉还没有消失,这时发现红叉是由于index.jsp页面中的The superclass "javax.servlet.http.HttpServlet" was not
解决办法 uncheck the option "resolve dependencies from workspace projects" from the maven tab of eclipse. 项目名称->属性->maven 把resolve dependencies from workspace projects 前面勾去掉
今天用了下lemon清理了下垃圾后,IDEA打开项目类文件图标由C变为J,在IDEA右侧的Maven Project中点击刷新提示IDEA Unable to import maven project: See logs for details. 解决方法: 这里由jre改为jdk,然后重启IDEA.
有些开源项目不直接提供jar包的下载,而是建议使用Maven下载,以开源库hipster(https://github.com/citiususc/hipster,http://www.hipster4j.org/)为例,使用Maven下载的配置方式如下: <dependencies> <!-- Add this dependency under your pom.xml <dependencies> section to add all the dependencies o