在關於您寫的JavaParser的另一個線程中:「它不應該有任何依賴性」。但JavaParser類具有相關性,以一種特殊的ParseException的:JavaParser:構造函數ParseException(String)未定義
在JavaParser類,line 205: throw new ParseException(ioe.getMessage())
構造ParseException的(字符串)是未定義 - 添加參數匹配ParseException的(字符串,整數) 例如java.text.ParseException(和另外三個)有一個int參數errorOffset。
在line 125 (and 8 more lines): new InstanceJavaParser(reader1).parse...()
的方法解析()從類型InstanceJavaParser指缺少類型ParseException的
我可以從哪裏獲得下載哪個罐子這個特殊的ParseException?
(編輯)
也許我應該提供比容納更多的細節爲註釋:
在Windows 10:安裝Maven的,MKDIR d:\工作區\幹線\ JavaParser類 - 從 - Maven的\
cmd
D:
cd D:\workspaces\trunk\JavaParser-from-Maven\
D:\workspaces\trunk\JavaParser-from-Maven>mvn archetype:generate -DgroupId=com.github.javaparser -DartifactId=javaparser-core -DinteractiveMode=false =>
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom (4 KB at 35.4 KB/sec)
[...] and many more .pom files [...]
[INFO] Generating project in Batch mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar (5 KB at 38.5 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.pom
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.pom (703 B at 5.5 KB/sec)
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: D:\workspaces\trunk\JavaParser-from-Maven
[INFO] Parameter: package, Value: com.github.javaparser
[INFO] Parameter: groupId, Value: com.github.javaparser
[INFO] Parameter: artifactId, Value: javaparser-core
[INFO] Parameter: packageName, Value: com.github.javaparser
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[...] => d:\工作空間\樹幹\ JavaParser類從 - Maven的\ JavaParser類核\ pom.xml中創建
d:\工作區\樹幹\ JavaParser類 - 創建來自Maven \ javaparser-core \ src \ main \ java \ com \ github \ javaparser \ App.java(1 KB),說「Hello World」
=>很多.pom文件和App .java已經下載,但是沒有JavaParser文件=> acc。 「如何編譯源代碼」:
一個版本的說法嘗試:
D:\workspaces\trunk\JavaParser-from-Maven>mvn archetype:generate -DgroupId=com.github.javaparser -DartifactId=javaparser-core -Dversion=2.1.0 -DinteractiveMode=false =>
[...] Building Maven Stub Project (No POM) 1
[...] [INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>>
=>很多.pom文件和一個App.java已經downloades,但沒有文件了JavaParser還
=> acc。 「如何編譯源代碼」:
cd javaparser-core // where the POM.xml resides
mvn clean install =>
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.jar (149 KB at 152.8 KB/sec)
[...] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javaparser-core ---
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom [...]
[...] [INFO] Changes detected - recompiling the module!
[...] T E S T S
Running com.github.javaparser.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
要產生額外的源文件:
D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core>mvn javacc:javacc =>
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/javacc-maven-plugin/maven-metadata.xml [...]
[...] [INFO] Building javaparser-core 2.1.0 [...]
Downloaded: ... .pom files ...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.4/maven-plugin-api-2.0.4.jar
Downloaded: ... another 57 .jar files ...
[INFO] Skipping non-existing source directory: D:\workspaces\trunk\JavaParser-from-Maven\javaparser-core\src\main\javacc
[INFO] BUILD SUCCESS
爲什麼我剛剛得到有關JavaParser類虛擬App.java並沒有什麼?
所有的.pom和.jar都去哪裏?
所有的.pom和.jar會有什麼影響?
我安裝了Maven並且遵循了這個「...... how-to-compile-sources」,但只得到了一個D:\ workspaces \ trunk \ JavaParser-from-Maven \ javaparser-core \ src \ main \ java \ com \ github \ javaparser \ App.java和一個... \ github \ javaparser \ App.class。 – Fifi
我原本打算獲得可編譯的* .java,而不是通過Git獲得的破碎的* .java。 – Fifi
App.java只是說「Hello World」 - 出了什麼問題?所有下載的POM文件受到了什麼影響? – Fifi