小编Gir*_*rma的帖子

无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:2.3.2

我知道这是因为我的 ~/.m2/ 存储库中的一个或多个 jar 文件已损坏,但我实际上无法确定哪些 jar 文件已损坏或哪些 jar,我需要删除并重新-下载。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-                 plugin:2.3.2:compile (default-compile) on project CRUDWebAppMavenized: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile: java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main :     Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:2.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/hp/.m2/repository/org/apache/maven/plugins/maven-   compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.jar
[ERROR] urls[1] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] urls[2] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-compiler-api/1.8.1/plexus-compiler-api-1.8.1.jar
[ERROR] urls[3] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-compiler-   manager/1.8.1/plexus-compiler-manager-1.8.1.jar
[ERROR] urls[4] = file:/C:/Users/hp/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: …
Run Code Online (Sandbox Code Playgroud)

java maven

5
推荐指数
0
解决办法
5503
查看次数

在运行时阅读装饰有特定注释的所有类

我需要在运行时阅读所有装饰有特定注释(例如@HttpSecurity)的类(接口)。扫描后,我希望阅读和解析装饰有注释的类的字段(枚举字段)。例如。

@HttpSecurity
public interface MyHttpSecurityConfig {

public enum secure {
    @Path(pathGroup = "/*", pathName = "")
    @Authc
    @Form(errorPage = "/error.html", loginPage = "/login.html", restoreOriginalRequest = "")
    @Authz
    @AllowedRoles(roles = { "roleA", "roleB" })
    @AllowedGroups(groups = { "groupA" })
    @AllowedRealms(realms = { "realmA" })
    @Expressions(expressions = { "#{identity.isLoggedIn()}" })
    Admin
  }
}
Run Code Online (Sandbox Code Playgroud)

可能存在一个或多个用@HttpSecurity装饰的类/接口。我的第一个要求是获取所有此类,第二个要求是通过读取注释及其在枚举字段上修饰的值来构建HttpSecurityBuilder。第二个要求很好,可以使用反射消除。但是,我的问题是第一个要求。我想用JavaSE核心实现第一个要求,即不使用任何外部依赖项,例如google Reflections。如有必要,可以假定我们具有要在其中扫描类的程序包名称。这是我做过什么用CDI

java reflection annotations cdi

1
推荐指数
1
解决办法
995
查看次数

标签 统计

java ×2

annotations ×1

cdi ×1

maven ×1

reflection ×1