小编ade*_*aud的帖子

Eclipse或Maven添加/定位到gitignore

我正在使用Maven和Git以及Java EE项目(EAR,EJB和WEB),在Eclipse中,工作区正在循环重建,因为有些东西会将"/ target"添加到我的.gitignore.

这是我的gitignore:

     *.class
    *.settings
    *.project
    *.classpath
    target
    # Package Files #
    *.jar
    *.war
    *.ear
    /target
    /target
    /target
    /target
    /target
    /target
... (more and more /target)
Run Code Online (Sandbox Code Playgroud)

知道什么可以添加这些线?

java eclipse git maven

9
推荐指数
2
解决办法
6349
查看次数

MongoDB试图连接到localhost,为什么?

我目前正在开发一个连接到远程MongoDB数据库的Java应用程序.

我已经实现了使用mongo指南的身份验证方法:

MongoCredential credential = MongoCredential.createScramSha1Credential(username, credentialDatabase, password.toCharArray());
MongoClient client = new MongoClient(new ServerAddress(hostname, port), Arrays.asList(credential));
mongoDatabase = client.getDatabase(database);
Run Code Online (Sandbox Code Playgroud)

应用程序正确连接到数据库,但有一件事我无法理解.它连接到远程服务器,但我不知道为什么它尝试连接到localhost:27017.

2016-03-07 16:13:29.662  INFO 12507 --- [*.*.*:25015] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:1, serverValue:29}] to *.*.*.*:25015

2016-03-07 16:13:29.687  INFO 12507 --- [*.*.*:25015] org.mongodb.driver.cluster               : Monitor thread successfully connected to server with description ServerDescription{address=*.*.*.*:25015, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 2, 3]}, minWireVersion=0, maxWireVersion=4, maxDocumentSize=16777216, roundTripTimeNanos=24485426}


2016-03-07 16:13:30.062  INFO 12507 --- [           main] org.mongodb.driver.cluster               : Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500} …
Run Code Online (Sandbox Code Playgroud)

java mongodb

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

标签 统计

java ×2

eclipse ×1

git ×1

maven ×1

mongodb ×1