gpt4 book ai didi

gwt - Wiered "[ERROR] Errors in ' jar :file. 。 gwt gradle 中的 .""无法解析为类型

转载 作者:行者123 更新时间:2023-12-03 06:03:21 24 4
gpt4 key购买 nike

我有一系列相互依赖的 GWT 项目,所有的链都编译得很好,但是最后一个元素似乎无法从生成的依赖 jar 中读取 java 类:

我检查了错误中的 jar,.java 和 .class 文件确实存在于它们应该在的位置:编译器找到包含所需类的 jar 真是太神奇了

ShopAdmin-1.0.jar



但它不读取它(许多类(class)都是这种情况,请参阅
the compilation output )
 [ERROR] Errors in 'jar:file:/C:/Users/Zied%20Hamdi/git/VuMe/ShopAdmin/build/libs/ShopAdmin-1.0.jar!/fr/onevu/vume/shopadmin/ShopAdmin.java'
[ERROR] fr.onevu.vume.shopadmin.ShopAdminClientFactory cannot be resolved to a type

你可以看到

ShopAdminClientFactory.java is in the same package as ShopAdmin.java


 R‚pertoire de c:\temp\ShopAdmin-1.0\fr\onevu\vume\shopadmin

25/10/2016 22:00 <REP> .
25/10/2016 22:00 <REP> ..
25/10/2016 22:00 <REP> activity
25/10/2016 22:00 <REP> activitymappers
25/10/2016 21:43 856 ContentManager$1.class
25/10/2016 21:43 1ÿ836 ContentManager.class
23/09/2016 19:29 988 ContentManager.java
25/10/2016 22:00 <REP> i18n
25/10/2016 22:00 <REP> request
25/10/2016 21:43 1ÿ225 ShopAdmin$1.class
25/10/2016 21:43 1ÿ112 ShopAdmin$2.class
25/10/2016 21:43 6ÿ486 ShopAdmin.class
23/09/2016 19:29 5ÿ439 ShopAdmin.java
25/10/2016 21:43 1ÿ488 ShopAdminActivityManager$1.class
25/10/2016 21:43 2ÿ907 ShopAdminActivityManager.class
27/09/2016 12:59 1ÿ962 ShopAdminActivityManager.java
25/10/2016 21:43 4ÿ466 ShopAdminClientFactory.class
23/09/2016 19:29 2ÿ838 ShopAdminClientFactory.java
25/10/2016 21:43 11ÿ472 ShopAdminClientFactoryImpl.class
23/09/2016 19:29 7ÿ249 ShopAdminClientFactoryImpl.java
25/10/2016 21:43 1ÿ638 ShopAdminEnvironment$1.class
25/10/2016 21:43 7ÿ853 ShopAdminEnvironment.class
23/09/2016 19:29 4ÿ060 ShopAdminEnvironment.java
25/10/2016 21:43 1ÿ476 ShopAdminFacade.class
23/09/2016 19:29 794 ShopAdminFacade.java
25/10/2016 21:43 1ÿ426 ShopAdminPlaceController.class
23/09/2016 19:29 1ÿ024 ShopAdminPlaceController.java
25/10/2016 22:00 <REP> view
21 fichier(s) 68ÿ595 octets

R‚pertoire de c:\temp\ShopAdmin-1.0\fr\onevu\vume\shopadmin\activity

此外,项目 Customer(正在编译)不包含 ShopAdmin.java,该文件位于依赖项目中(客户依赖于所有其他项目)。奇怪的是,在编译 Customer 时,错误是关于不在 Customer 中但在其直接依赖项 ShopAdmin 中的类(客户始终是商店管理员)。
/**
* app engine conf found on https://cloud.google.com/appengine/docs/java/tools/gradle
*/

group = 'fr.onevu.vume'
version = '1.0'

apply plugin: 'war'
apply plugin: 'java'
apply plugin: 'gwt'
apply plugin: 'eclipse'
apply plugin: 'jetty'
apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks


//Java version compatibility to use when compiling Java source.
sourceCompatibility = 1.7
//Java version to generate classes for.
targetCompatibility = 1.7

buildscript {
repositories {
jcenter() //repository where to fetch gwt gradle plugin
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+' // latest App Engine Gradle tasks
}
}

// central repository to load the GWT library
repositories {
maven {
url 'https://maven-central.storage.googleapis.com' // Google's mirror of Maven Central
// url 'https://oss.sonatype.org/content/repositories/snapshots' // SNAPSHOT Repository (if needed)
}

jcenter()
mavenCentral()
}

dependencies {
// https://mvnrepository.com/artifact/com.google.appengine/gradle-appengine-plugin
compile group: 'com.google.appengine', name: 'gradle-appengine-plugin', version: '1.9.42'
compile project(':VuMetest')

// needed for Maps API
compile group: 'com.google.gwt.google-apis', name: 'gwt-ajaxloader', version: '1.0.0'
// https://mvnrepository.com/artifact/com.google.gwt/gwt-user
compile group: 'com.google.gwt', name: 'gwt-user', version: '2.7.0'

compile fileTree(dir: 'libs', include: '*.jar')
}


gwt {
gwtVersion='2.7.0'
modules 'fr.onevu.vume.ShopAdmin'

logLevel = 'ERROR'

minHeapSize = "1024M";
maxHeapSize = "2048M";

superDev {
noPrecompile=true
}

// The following is only needed if you don't use the Google Plugin for Eclipse.
eclipse{
addGwtContainer=true // Default set to true
}

//Specify the deployment Port
jettyRunWar.httpPort = 8089
}

jar {
manifest {
attributes 'Implementation-Title': 'IntoGwt', 'Implementation-Version': version
}
from project.sourceSets.main.allJava
from('src/main/java') {
include '**/*.xml'
include '**/*.css'
include '**/*.png'
include '**/*.properties'
exclude '**JUnit**'
}

}

但生成的 jar 文件已准备好所有内容:解压缩 jar 包含应该存在的类:

有任何想法吗?

最好的问候,
齐德

最佳答案

行!

那是我的错,我暂时不必手动解决依赖关系。这只是一个类路径问题(手动添加的 jar,因为它在 maven 上不可用)

我只需要跟踪未解析的符号原因链,直到找到对//https://mvnrepository.com/artifact/com.google.gwt.google-apis/gwt-ajaxloader 的依赖项
编译组:“com.google.gwt.google-apis”,名称:“gwt-ajaxloader”,版本:“1.1.0”未添加

关于gwt - Wiered "[ERROR] Errors in ' jar :file. 。 gwt gradle 中的 .""无法解析为类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40260921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com