第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

如何使用遠(yuǎn)程 Maven 存儲庫

如何使用遠(yuǎn)程 Maven 存儲庫

楊__羊羊 2021-06-05 14:51:43
我正在嘗試為 Apache Ignite 配置持久存儲,以便我的 IgniteCache 實(shí)例不會在應(yīng)用程序重啟時(shí)丟失數(shù)據(jù)。我的設(shè)置是從我的代碼開始的本地單節(jié)點(diǎn)集群,如下所示:IgniteConfiguration cfg = new IgniteConfiguration();cfg.setWorkDirectory("C:\\ignite");// Ignite persistence configuration.DataStorageConfiguration storageCfg = new DataStorageConfiguration();storageCfg.setStoragePath("ignitedb/storage");storageCfg.setWalPath("ignitedb/wal");storageCfg.setWalArchivePath("ignitedb/wal/archive");// Enabling the persistence.storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);// Applying settings.cfg.setDataStorageConfiguration(storageCfg);Ignite ignite = Ignition.getOrStart(cfg);ignite.active(true);// Get all server nodes that are already up and running.Collection<ClusterNode> nodes = ignite.cluster().forServers().nodes();// Set the baseline topology that is represented by these nodes.ignite.cluster().setBaselineTopology(nodes);return ignite;緩存是這樣創(chuàng)建的:cacheConfiguration = new CacheConfiguration<>();cacheConfiguration.setBackups(1);cacheConfiguration.setAtomicityMode(CacheAtomicityMode.ATOMIC);cacheConfiguration.setName("UserCache");cacheConfiguration.setCacheMode(CacheMode.LOCAL);cacheConfiguration.setReadFromBackup(true);cacheConfiguration.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);cacheConfiguration.setIndexedTypes(String.class, User.class);IgniteCache<String, User> cache = ignite.getOrCreateCache(cacheConfiguration);User在緩存中存儲對象有效。Ignite 在C:\ignite. 但是在應(yīng)用程序重新啟動時(shí),所有數(shù)據(jù)都會丟失。我該如何正確配置?
查看完整描述

3 回答

?
慕桂英4014372

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超13個(gè)贊

通常您應(yīng)該在 Maven Central Repository 中檢查您需要的所有依賴項(xiàng)。您將能夠在那里找到大多數(shù)“免費(fèi)”依賴項(xiàng)。只有少數(shù)情況下您將無法在那里找到您需要的內(nèi)容。

在確定您需要的依賴項(xiàng)和您需要的版本后,您將在左側(cè)看到如下所示的內(nèi)容:

http://img1.sycdn.imooc.com//60c1caac00010bb203720306.jpg

那里的信息可以很容易地復(fù)制粘貼到您的項(xiàng)目中。此外,強(qiáng)烈建議通過定義變量對所有相關(guān)并一起發(fā)布的依賴項(xiàng)使用相同的版本。


你定義一個(gè)這樣的變量:


<properties>

    <spring.version>5.0.7.RELEASE</spring.version> --> the version from maven central

</properties>

然后你可以像這樣包含依賴:


<dependency>

    <groupId>org.springframework</groupId>

    <artifactId>spring-beans</artifactId>

    <version>${spring.version}</version>

</dependency>

而如果你有多個(gè)pom.xml文件,并且存在父->子關(guān)系,則不需要在子文件中包含依賴版本,因?yàn)樗鼤詣永^承父的版本。你將能夠做這樣的事情:


<dependency>

    <groupId>org.springframework</groupId>

    <artifactId>spring-beans</artifactId>

</dependency>

特別是對于 Spring,如果您需要多個(gè)依賴項(xiàng),我建議您查看 spring-boot。您可以在此處找到有關(guān) spring-boot 的更多信息。此外,當(dāng)您使用 spring-boot 時(shí),通常不需要手動處理依賴項(xiàng)的版本。


來自鏈接的引用:


Spring Boot 可以輕松創(chuàng)建獨(dú)立的、生產(chǎn)級的基于 Spring 的應(yīng)用程序,您可以“直接運(yùn)行”這些應(yīng)用程序。


我們對 Spring 平臺和第三方庫采取了固執(zhí)的觀點(diǎn),因此您可以輕松上手。大多數(shù) Spring Boot 應(yīng)用程序只需要很少的 Spring 配置。


總而言之,您不需要添加另一個(gè)存儲庫groupId,您的依賴項(xiàng)應(yīng)如下所示:<groupId>org.springframework</groupId>,一切都會正常進(jìn)行。


查看完整回答
反對 回復(fù) 2021-06-10
?
繁華開滿天機(jī)

TA貢獻(xiàn)1816條經(jīng)驗(yàn) 獲得超4個(gè)贊

<dependency>

    <groupId>org.springframework</groupId>

    <artifactId>spring-beans</artifactId>

    <version>5.0.0.RELEASE</version>

</dependency>

刪除組 id 上的 spring-beans



查看完整回答
反對 回復(fù) 2021-06-10
?
MMTTMM

TA貢獻(xiàn)1869條經(jīng)驗(yàn) 獲得超4個(gè)贊

刪除groupId中的.spring-beans

只需改變你<groupId>org.springframework.spring-beans</groupId><groupId>org.springframework</groupId>


查看完整回答
反對 回復(fù) 2021-06-10
  • 3 回答
  • 0 關(guān)注
  • 237 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號