注意:我使用的是Maven 3+,请参阅评论。
我正在尝试使用Maven和WAS7编译项目,但遗憾的是似乎收到了以下错误:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ERROR] Error executing Maven.
[ERROR] com.google.inject.ProvisionException: Guice provision errors:
1) Error in custom provider, java.lang.TypeNotPresentException: Type javax.enterprise.inject.Typed not present
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.sonatype.plexus.components.cipher.PlexusCipher
while locating org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.sonatype.plexus.components.sec.dispatcher.SecDispatcher annotated with @com.google.inject.name.Named(value=maven)
while locating org.apache.maven.settings.crypto.DefaultSettingsDecrypter
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.settings.crypto.SettingsDecrypter
while locating org.apache.maven.repository.legacy.LegacyRepositorySystem
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.repository.RepositorySystem
while locating org.apache.maven.project.DefaultProjectBuildingHelper
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.project.ProjectBuildingHelper
while locating org.apache.maven.project.DefaultProjectBuilder
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.project.ProjectBuilder
while locating org.apache.maven.DefaultMaven
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.Maven
1 error
role: org.apache.maven.Maven
roleHint:
[ERROR] Caused by: Guice provision errors:
1) Error in custom provider, java.lang.TypeNotPresentException: Type javax.enterprise.inject.Typed not present
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.sonatype.plexus.components.cipher.PlexusCipher
while locating org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.sonatype.plexus.components.sec.dispatcher.SecDispatcher annotated with @com.google.inject.name.Named(value=maven)
while locating org.apache.maven.settings.crypto.DefaultSettingsDecrypter
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.settings.crypto.SettingsDecrypter
while locating org.apache.maven.repository.legacy.LegacyRepositorySystem
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.repository.RepositorySystem
while locating org.apache.maven.project.DefaultProjectBuildingHelper
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.project.ProjectBuildingHelper
while locating org.apache.maven.project.DefaultProjectBuilder
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.project.ProjectBuilder
while locating org.apache.maven.DefaultMaven
at ClassRealm[plexus.core, parent: null]
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.Maven
1 error
[ERROR] Caused by: Type javax.enterprise.inject.Typed not present
[ERROR] Caused by: javax.enterprise.inject.Typed
我已经确认JRE系统库是WAS 7,检查它是JavaSE-1.6,在我的例子中指向WAS7。
我尝试过寻找javax.enterprise.inject.Typed并且它似乎没有出现在任何地方,但它是JavaEE6的一部分,这就是(我认为)WAS 7的基础。
答案 0 :(得分:2)
基本上发生的事情是我使用了与myeclipse打包的嵌入式Maven版本。
这个版本的maven是v3.0.4,它使用guice而不是plexus来注入依赖项。 Guice使用JavaEE6中的组件,这些组件在WAS7扩展的JavaEE5中不存在。
所以基本上解决这个问题指向
答案 1 :(得分:0)
SpaceTrucker的评论是现货。缺少的类是JavaEE 6的一部分,WAS7仅支持JavaEE 5.对于功能比较,请参阅The Wikipedia entry
答案 2 :(得分:0)
转到RAD - >窗口 - >首选项 - > Maven - >安装
添加您的maven文件夹路径
现在转到项目并右键单击项目 - > Maven - >更新项目