我從不下載快照版本。但爲了實施a project我必須使用RichText。如何下載快照版本?
我想下載snapshot的版本以供使用。因爲IntelliJ IDE找不到以前版本import org.fxmisc.richtext.model.StyledSegment;
。
我對快照發布,maven,gradle一無所知。
我只需要最新版本的jar文件。
請給我一個獲取jar文件的直接建議。
編輯
現在我想至少運行RichText.java
我從不下載快照版本。但爲了實施a project我必須使用RichText。如何下載快照版本?
我想下載snapshot的版本以供使用。因爲IntelliJ IDE找不到以前版本import org.fxmisc.richtext.model.StyledSegment;
。
我對快照發布,maven,gradle一無所知。
我只需要最新版本的jar文件。
請給我一個獲取jar文件的直接建議。
編輯
現在我想至少運行RichText.java
您正在使用ANT build tool。即使有一種方法可以在Ant中使用Maven依賴關係(請參閱此question),如果您不限制使用ant,我建議將該項目轉移到maven或gradle。
不過:如果你想使用Maven
:
例如pom.xml
<dependencies>
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Public</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
,如果你想使用Gradle:
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '1.0.0-SNAPSHOT'
}
編輯
Maven遵循standard directory structure。你需要在根目錄下有pom.xml,在src/main/java
的源java文件,像src/main/resources
中的png和css這樣的資源。如果你想執行主類,你可以使用Exec maven plugin,你可以指定你的主類。見image。
當你想運行應用程序:
clean
package
exec:java
或者,如果你更喜歡終端,你可以使用mvn clean package exec:java
我使用maven,但結果是[this](https://imgur.com/uveWDwe)。 – alhelal
如果你使用Maven,你的'pom.xml'在哪裏?沒有它你不能使用Maven。 –
@alhelal我編輯了答案,我希望它有幫助。 – xstefank