【问题标题】:Petclinic spring-mvc example not buildingPetclinic spring-mvc 示例未构建
【发布时间】:2011-03-25 21:05:35
【问题描述】:

我只是与https://src.springframework.org/svn/spring-samples/ 合作并尝试建立宠物诊所。 我做到了:

  • mvn 全新安装
  • mvn eclipse:eclipse

我导入到 eclipse 但是:

The import org.aspectj cannot be resolved

pom.xml 错误的几率是多少,我必须自己添加依赖项?

【问题讨论】:

  • 我想知道您在尝试使用 STS 时是如何导入项目的,因为在使用 m2eclipse 时,无论是在 Eclipse 中还是在 STS 中,我都无法重现该问题。我猜你没有使用 Import...> Existing Maven Projects
  • 不。我做了mvn eclipse:eclipse,然后将它作为一个eclipse项目导入。

标签: eclipse spring maven-2 spring-mvc aspectj


【解决方案1】:

这是 maven eclipse 插件中已知的bug

一个简单的解决方法是在您的 POM 的 maven-eclipse-plugin 配置部分中指定 adjtVersion(或者只是更新您的版本:D):

<ajdtVersion>none</ajdtVersion>

EclipseClassPathWriter 包含以下代码:

    // Skip aspectj libraries since they are in the container.
            if ( ( config.getAjdtVersion() != 0 ) &&
               dep.getArtifactId().toLowerCase().indexOf( "aspectj" ) >= 0 )
            {
                return;
            }

【讨论】:

  • 是的,我想这与此有关。将它添加到我的 pom 并不能解决问题,但手动添加 jar 是可行的,所以我猜你是对的。
猜你喜欢
  • 1970-01-01
  • 2013-09-09
  • 1970-01-01
  • 1970-01-01
  • 2014-06-26
  • 1970-01-01
  • 2011-02-05
  • 1970-01-01
  • 2015-01-07
相关资源
最近更新 更多