installation curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add – echo “deb [arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org- 4.4.list sudo apt update sudo apt install mongodb-org Start service Start MongoDB. sudo systemctl start mongod.service Check if it is active. sudo systemctl status mongod It starts automatically after booting. sudo systemctl enable mongod Check the connection, pay attention to whether it shows ok:1. mongo –eval'db.runCommand({ connectionStatus: 1 })' basic configuration Connect. mongo --host 127.0.0.1:27017 Set up the first administrator account, with the highest authority account, and then use it to set up other accounts. use admin; db.createUser( { user: “develop”, pwd: “1qaz@WSX#EDC”, roles: [{role: “userAdminAnyDatabase”, db: “admin”}] } ); exit; Open MongoDB authentication login. sudo vi /etc/mongod.conf Add the following sections: s...
For projects with multiple Gradle projects, if the main project is executing unit test, other sub-projects will be executed together, and some advanced settings are required. First refer to another article, use eclipse to configure two SpringBoot projects: lab-springboot, library1. Gradle references the level project First, modify the build.gradle of library1 and add these codes at the bottom of the file: configurations { // Gradle DSL // The names of the configurations which this configuration extends from. testOutput.extendsFrom (testImplementation) } task jarTest (type: Jar, dependsOn: testClasses) { from sourceSets.test.output classifier = 'test' // The classifier distinguishes different artifacts build from the same project. } artifacts { testOutput jarTest } Then modify the build.gradle of lab-springboot and add these codes at the bottom of the file. Note that there may be other codes in the dependencies: dependencies { im...
Gradle is a very powerful tool. Many multi-project management teachings on Gradle on the Internet are not written very complicated, or they are wrong. Suppose we have a main project, lab-springboot, and another parallel sub-project called library1. The main project will call the sub-project's library. The directory structure is as follows and can be placed in any directory: lab-springboot library1 This tutorial demonstrates how to use eclipse to create a Gradle project with such a structure. First, add a SpringBoot project. Of course, eclipse must have Spring related toolchain installed. Select Spring Boot→Spring Starter Project, and select Gradle as Type: Next, add a sub-project library1, select Gradle→Gradle Project: After the construction is completed, eclipse will display two projects, which are also equal in the physical save path. Change Library.java in library1 and change someLibraryMethod to static. public class Library { public static boolean someLibraryMethod() { ...
Comments
Post a Comment