https://www.sonatype.com/download-oss-sonatype

 

http://www.sonatype.org/downloads/nexus-2.1.2-bundle.tar.g

 

 

java环境

wget https://dragonwell.oss-cn-shanghai.aliyuncs.com/8/8.6.5-GA/Alibaba_Dragonwell_8.6.5_GA_Linux_x64.ta
r.gz

tar -zxvf Alibaba_Dragonwell_8.6.5_GA_Linux_x64.tar.gz 
 vim /etc/profile

export JAVA_HOME=/root/jdk8u282-b1
export PATH=$PATH:$JAVA_HOME/bin

[root@cvm-3i2fmpd28a225 jdk8u282-b1]# java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (Alibaba Dragonwell 8.6.5) (build 1.8.0_282-b1)
OpenJDK 64-Bit Server VM (Alibaba Dragonwell 8.6.5) (build 25.282-b1, mixed mode)

 

 

  

nexus

http://www.sonatype.org/downloads/nexus-2.1.2-bundle.tar.gz

 

tar -zxvf nexus-3.29.2-02-unix.tar.gz 

 

 

[root@cvm-3i2fmpd28a225 bin]# ./nexus start 
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Starting nexus

 

不允许root用户启动服务

 

[root@cvm-3i2fmpd28a225 bin]# vim nexus.rc

run_as_user="root"

 

[root@cvm-3i2fmpd28a225 bin]# ./nexus start
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Starting nexus

 

[root@cvm-3i2fmpd28a225 bin]# ps -ef|grep nexus
root 450614 1 49 19:15 pts/1 00:01:32 /root/jdk8u282-b1/bin/java -server -Dinstall4j.jvmDir=/root
/jdk8u282-b1 -Dexe4j.moduleName=/root/nexus-3.29.2-02/bin/nexus -XX:+UnlockDiagnosticVMOptions -Dinstall4j.launcherId=245 -Dinstall4j.swt=false -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=../sonatype-work/nexus3/log/jvm.log -XX:-OmitStackTraceInFastThrow -Djava.net.preferIPv4Stack=true -Dkaraf.home=. -Dkaraf.base=. -Dkaraf.etc=etc/karaf -Djava.util.logging.config.file=etc/karaf/java.util.logging.properties -Dkaraf.data=../sonatype-work/nexus3 -Dkaraf.log=../sonatype-work/nexus3/log -Djava.io.tmpdir=../sonatype-work/nexus3/tmp -Dkaraf.startLocalConsole=false -Djava.endorsed.dirs=lib/endorsed -Di4j.vpt=true -classpath /root/nexus-3.29.2-02/.install4j/i4jruntime.jar:/root/nexus-3.29.2-02/lib/boot/nexus-main.jar:/root/nexus-3.29.2-02/lib/boot/activation-1.1.1.jar:/root/nexus-3.29.2-02/lib/boot/jakarta.xml.bind-api-2.3.3.jar:/root/nexus-3.29.2-02/lib/boot/jaxb-runtime-2.3.3.jar:/root/nexus-3.29.2-02/lib/boot/txw2-2.3.3.jar:/root/nexus-3.29.2-02/lib/boot/istack-commons-runtime-3.0.10.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.main-4.2.9.jar:/root/nexus-3.29.2-02/lib/boot/osgi.core-6.0.0.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.specs.activator-4.2.9.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.diagnostic.boot-4.2.9.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.jaas.boot-4.2.9.jar com.install4j.runtime.launcher.UnixLauncher start 9d17dc87 0 0 org.sonatype.nexus.karaf.NexusMainroot 450960 449857 0 19:18 pts/1 00:00:00 grep --color=auto nexus

 

[root@cvm-3i2fmpd28a225 bin]# ss -ntlp|grep java
LISTEN 0 1 127.0.0.1:35171 0.0.0.0:* users:(("java",pid=450614,fd=1
15))

 

 

[root@cvm-3i2fmpd28a225 bin]# ./nexus status 
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
nexus is running.
[root@cvm-3i2fmpd28a225 bin]# ./nexus stop
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Shutting down nexus

 

[root@cvm-3i2fmpd28a225 bin]# ps -ef|grep nexus
root 450614 1 7 19:15 ? 00:03:18 /root/jdk8u282-b1/bin/java -server -Dinstall4j.jvmDir=/root
/jdk8u282-b1 -Dexe4j.moduleName=/root/nexus-3.29.2-02/bin/nexus -XX:+UnlockDiagnosticVMOptions -Dinstall4j.launcherId=245 -Dinstall4j.swt=false -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=../sonatype-work/nexus3/log/jvm.log -XX:-OmitStackTraceInFastThrow -Djava.net.preferIPv4Stack=true -Dkaraf.home=. -Dkaraf.base=. -Dkaraf.etc=etc/karaf -Djava.util.logging.config.file=etc/karaf/java.util.logging.properties -Dkaraf.data=../sonatype-work/nexus3 -Dkaraf.log=../sonatype-work/nexus3/log -Djava.io.tmpdir=../sonatype-work/nexus3/tmp -Dkaraf.startLocalConsole=false -Djava.endorsed.dirs=lib/endorsed -Di4j.vpt=true -classpath /root/nexus-3.29.2-02/.install4j/i4jruntime.jar:/root/nexus-3.29.2-02/lib/boot/nexus-main.jar:/root/nexus-3.29.2-02/lib/boot/activation-1.1.1.jar:/root/nexus-3.29.2-02/lib/boot/jakarta.xml.bind-api-2.3.3.jar:/root/nexus-3.29.2-02/lib/boot/jaxb-runtime-2.3.3.jar:/root/nexus-3.29.2-02/lib/boot/txw2-2.3.3.jar:/root/nexus-3.29.2-02/lib/boot/istack-commons-runtime-3.0.10.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.main-4.2.9.jar:/root/nexus-3.29.2-02/lib/boot/osgi.core-6.0.0.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.specs.activator-4.2.9.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.diagnostic.boot-4.2.9.jar:/root/nexus-3.29.2-02/lib/boot/org.apache.karaf.jaas.boot-4.2.9.jar com.install4j.runtime.launcher.UnixLauncher start 9d17dc87 0 0 org.sonatype.nexus.karaf.NexusMainroot 451996 451506 0 19:57 pts/1 00:00:00 grep --color=auto nexus
[root@cvm-3i2fmpd28a225 bin]# pkill -9 java
[root@cvm-3i2fmpd28a225 bin]# ps -ef|grep nexus
root 452004 451506 0 19:57 pts/1 00:00:00 grep --color=auto nexus
[root@cvm-3i2fmpd28a225 bin]# ./nexus start 
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
Starting nexus
[root@cvm-3i2fmpd28a225 bin]# ./nexus status 
WARNING: ************************************************************
WARNING: Detected execution as "root" user. This is NOT recommended!
WARNING: ************************************************************
nexus is running.

  

 

 

重新安装nexus

参考文章:https://www.cnblogs.com/YingYue/p/6045604.html

wget https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-2.11.2-03-bundle.tar.gz

 mkdir -p /usr/local/nexus
 tar -zxvf nexus-2.11.2-03-bundle.tar.gz -C /usr/local/nexus/
 cd /usr/local/nexus/
 cd nexus-2.11.2-03/
cd conf/

 


vim nexus.properties

# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-webapp=${bundleBasedir}/nexus
nexus-webapp-context-path=/nexus

# Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF

 

 vim ../bin/nexus

# Set this to the root of the Nexus installation
NEXUS_HOME="/usr/local/nexus/nexus-2.11.2-03"

# If specified, the Wrapper will be run as the specified user.

# IMPORTANT - Make sure that the user has the required privileges to write into the Nexus installation director
y.
# NOTE - This will set the user which is used to run the Wrapper as well as
# the JVM and is not useful in situations where a privileged resource or
# port needs to be allocated prior to the user being changed.
RUN_AS_USER=root

 ./nexus start 
启动之后需要等待,过一会服务才能启动成功

 curl http://127.0.0.1:8081/nexus
 

ps -ef|grep nexus


curl http://127.0.0.1:8081/nexus

  

 

 

 

 

 

用户默认:admin , admin123

 

mavn 使用nexus

https://www.cnblogs.com/knowledgesea/p/11190579.html

 

 

 

 

 

 

 

 

 

 

 

 

 

关联自己的私有仓库

1.在settings.xml文件中添加镜像文件关联

 

 

 

项目依赖

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.lzj1234</groupId>
    <artifactId>microservice-provider-user</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>2.4.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.4.2</version>
        </dependency>

        <!-- 引入H2数据库,一种内嵌的数据库,语法类似MySQL -->
        <!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.200</version>
<!--            <scope>test</scope>-->
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.18</version>
            <scope>provided</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.4.2</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.5</version>
        </dependency>

    </dependencies>

    <!-- 引入spring cloud的依赖,不能少,主要用来管理Spring Cloud生态各组件的版本 -->
    <dependencyManagement>
        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Hoxton.SR10</version>
                <type>pom</type>
                <scope>runtime</scope>
            </dependency>


        </dependencies>
    </dependencyManagement>

<!--    <build>-->
<!--        <plugins>-->
<!--            <!– 添加spring-boot的maven插件,不能少,打jar包时得用 –>-->
<!--            <plugin>-->
<!--                <groupId>org.springframework.boot</groupId>-->
<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
<!--                <version>2.4.2</version>-->
<!--            </plugin>-->
<!--        </plugins>-->
<!--    </build>-->
    <build>

        <plugins>
            <!-- 添加spring-boot的maven插件,不能少,打jar包时得用 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.4.2</version>
            </plugin>
            <plugin>

                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin   -source 1.5 中不支持 lambda 表达式  maven编译报错 -source 1.5 中不支持 lambda 表达式 -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>


                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>

    </build>
</project>

  



 

setting.xml

 

  <mirror>

    <id>aliyunmaven</id>

    <mirrorOf>*</mirrorOf>

    <name>阿里云公共仓库</name>

    <url>https://maven.aliyun.com/repository/public</url>

</mirror>



 <mirror>

    <id>aliyunmaven2</id>

    <mirrorOf>*</mirrorOf>

    <name>阿里云公共仓库</name>

    <url>http://repository.apache.org/content/groups/snapshots/?spm=a2c40.maven_devops2020_goldlog_.0.0.43643054AxL62v/</url>

</mirror>

	<mirror>     

       <id>nexus-snapshots</id>     

      <mirrorOf>*</mirrorOf>     

       <url>http://103.153.37.51:8081/nexus/content/repositories/apache-snapshots/</url>     

     </mirror> 

	 <mirror>     

      <id>nexus-releases</id>     

      <mirrorOf>*</mirrorOf>     

      <url>http://103.153.37.51:8081/nexus/content/groups/public</url>     

    </mirror> 

  

 

测试项目运行

C:\Users\l\javademo\microservice-provider-user>mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.lzj1234:microservice-provider-user >---------------
[INFO] Building microservice-provider-user 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.4.2:run (default-cli) > test-compile @ microservice-provider-user >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ microservice-provider-user ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ microservice-provider-user ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ microservice-provider-user ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ microservice-provider-user ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.4.2:run (default-cli) < test-compile @ microservice-provider-user <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.2:run (default-cli) @ microservice-provider-user ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.2)

2021-02-18 23:41:43.645  INFO 10524 --- [           main] com.src.App                              : Starting App using Java 1.8.0_111 on DESKTOP-SRVQTV7 with PID 10524 (C:\Users\l\j
avademo\microservice-provider-user\target\classes started by l in C:\Users\l\javademo\microservice-provider-user)
2021-02-18 23:41:43.649  INFO 10524 --- [           main] com.src.App                              : No active profile set, falling back to default profiles: default
2021-02-18 23:41:44.230  INFO 10524 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-02-18 23:41:44.283  INFO 10524 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 45 ms. Found 1 JPA repository interfa
ces.
2021-02-18 23:41:45.627  INFO 10524 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8000 (http)
2021-02-18 23:41:45.637  INFO 10524 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-02-18 23:41:45.637  INFO 10524 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-02-18 23:41:45.726  INFO 10524 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-02-18 23:41:45.727  INFO 10524 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2028 ms
2021-02-18 23:41:45.789  WARN 10524 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt:
 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfi
ed dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defin
ed in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.sp
ringframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.sprin
gframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2021-02-18 23:41:45.792  INFO 10524 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-02-18 23:41:45.804  INFO 10524 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-02-18 23:41:45.837 ERROR 10524 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
        If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
        If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.977 s
[INFO] Finished at: 2021-02-18T23:41:45+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:run (default-cli) on project microservice-provider-user: Application finished with exit code: 1
 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

C:\Users\l\javademo\microservice-provider-user>mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.lzj1234:microservice-provider-user >---------------
[INFO] Building microservice-provider-user 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.4.2:run (default-cli) > test-compile @ microservice-provider-user >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ microservice-provider-user ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ microservice-provider-user ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ microservice-provider-user ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ microservice-provider-user ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.4.2:run (default-cli) < test-compile @ microservice-provider-user <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.2:run (default-cli) @ microservice-provider-user ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.2)

2021-02-18 23:42:29.708  INFO 21312 --- [           main] com.src.App                              : Starting App using Java 1.8.0_111 on DESKTOP-SRVQTV7 with PID 21312 (C:\Users\l\j
avademo\microservice-provider-user\target\classes started by l in C:\Users\l\javademo\microservice-provider-user)
2021-02-18 23:42:29.712  INFO 21312 --- [           main] com.src.App                              : No active profile set, falling back to default profiles: default
2021-02-18 23:42:30.674  INFO 21312 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-02-18 23:42:30.727  INFO 21312 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 44 ms. Found 1 JPA repository interfa
ces.
2021-02-18 23:42:32.064  INFO 21312 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8000 (http)
2021-02-18 23:42:32.074  INFO 21312 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-02-18 23:42:32.075  INFO 21312 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-02-18 23:42:32.160  INFO 21312 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-02-18 23:42:32.161  INFO 21312 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2398 ms
2021-02-18 23:42:32.224  WARN 21312 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt:
 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfi
ed dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defin
ed in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.sp
ringframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.sprin
gframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2021-02-18 23:42:32.227  INFO 21312 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-02-18 23:42:32.239  INFO 21312 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-02-18 23:42:32.262 ERROR 21312 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
        If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
        If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.078 s
[INFO] Finished at: 2021-02-18T23:42:32+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:run (default-cli) on project microservice-provider-user: Application finished with exit code: 1
 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

C:\Users\l\javademo\microservice-provider-user>mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.lzj1234:microservice-provider-user >---------------
[INFO] Building microservice-provider-user 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.4.2:run (default-cli) > test-compile @ microservice-provider-user >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ microservice-provider-user ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ microservice-provider-user ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ microservice-provider-user ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ microservice-provider-user ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.4.2:run (default-cli) < test-compile @ microservice-provider-user <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.2:run (default-cli) @ microservice-provider-user ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.2)

2021-02-18 23:44:18.052  INFO 18312 --- [           main] com.src.App                              : Starting App using Java 1.8.0_111 on DESKTOP-SRVQTV7 with PID 18312 (C:\Users\l\j
avademo\microservice-provider-user\target\classes started by l in C:\Users\l\javademo\microservice-provider-user)
2021-02-18 23:44:18.056  INFO 18312 --- [           main] com.src.App                              : No active profile set, falling back to default profiles: default
2021-02-18 23:44:18.639  INFO 18312 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-02-18 23:44:18.691  INFO 18312 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 43 ms. Found 1 JPA repository interfa
ces.
2021-02-18 23:44:20.049  INFO 18312 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8000 (http)
2021-02-18 23:44:20.060  INFO 18312 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-02-18 23:44:20.061  INFO 18312 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-02-18 23:44:20.145  INFO 18312 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-02-18 23:44:20.145  INFO 18312 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2043 ms
2021-02-18 23:44:20.282  INFO 18312 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2021-02-18 23:44:20.383  INFO 18312 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2021-02-18 23:44:20.428  INFO 18312 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-02-18 23:44:20.472  INFO 18312 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.27.Final
2021-02-18 23:44:20.593  INFO 18312 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-02-18 23:44:20.702  INFO 18312 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
Hibernate: drop table if exists user CASCADE
Hibernate: drop sequence if exists hibernate_sequence
Hibernate: create sequence hibernate_sequence start with 1 increment by 1
Hibernate: create table user (id bigint not null, age integer, balance decimal(19,2), name varchar(255), username varchar(255), primary key (id))
2021-02-18 23:44:21.263  INFO 18312 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jt
a.platform.internal.NoJtaPlatform]
2021-02-18 23:44:21.271  INFO 18312 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-02-18 23:44:21.535  WARN 18312 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be
 performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-02-18 23:44:21.644  INFO 18312 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-18 23:44:21.825  INFO 18312 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8000 (http) with context path ''
2021-02-18 23:44:21.832  INFO 18312 --- [           main] com.src.App                              : Started App in 4.236 seconds (JVM running for 4.648)
Hibernate: select user0_.id as id1_0_0_, user0_.age as age2_0_0_, user0_.balance as balance3_0_0_, user0_.name as name4_0_0_, user0_.username as username5_0_0_ from user user0_ where
 user0_.id=?
2021-02-18 23:44:21.883 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [BIGINT] - [1]
Hibernate: call next value for hibernate_sequence
Hibernate: insert into user (age, balance, name, username, id) values (?, ?, ?, ?, ?)
2021-02-18 23:44:21.910 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [INTEGER] - [20]
2021-02-18 23:44:21.912 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [2] as [NUMERIC] - [100]
2021-02-18 23:44:21.914 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [3] as [VARCHAR] - [瀵姳绗乚
2021-02-18 23:44:21.917 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [4] as [VARCHAR] - [account1]
2021-02-18 23:44:21.917 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [5] as [BIGINT] - [1]
Hibernate: select user0_.id as id1_0_0_, user0_.age as age2_0_0_, user0_.balance as balance3_0_0_, user0_.name as name4_0_0_, user0_.username as username5_0_0_ from user user0_ where
 user0_.id=?
2021-02-18 23:44:21.922 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [BIGINT] - [2]
Hibernate: call next value for hibernate_sequence
Hibernate: insert into user (age, balance, name, username, id) values (?, ?, ?, ?, ?)
2021-02-18 23:44:21.923 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [INTEGER] - [28]
2021-02-18 23:44:21.924 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [2] as [NUMERIC] - [180]
2021-02-18 23:44:21.924 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [3] as [VARCHAR] - [閺夊骸娲揮
2021-02-18 23:44:21.924 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [4] as [VARCHAR] - [account2]
2021-02-18 23:44:21.925 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [5] as [BIGINT] - [2]
Hibernate: select user0_.id as id1_0_0_, user0_.age as age2_0_0_, user0_.balance as balance3_0_0_, user0_.name as name4_0_0_, user0_.username as username5_0_0_ from user user0_ where
 user0_.id=?
2021-02-18 23:44:21.927 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [BIGINT] - [3]
Hibernate: call next value for hibernate_sequence
Hibernate: insert into user (age, balance, name, username, id) values (?, ?, ?, ?, ?)
2021-02-18 23:44:21.929 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [1] as [INTEGER] - [32]
2021-02-18 23:44:21.930 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [2] as [NUMERIC] - [280]
2021-02-18 23:44:21.931 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [3] as [VARCHAR] - [閻滃绨瞉
2021-02-18 23:44:21.932 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [4] as [VARCHAR] - [account3]
2021-02-18 23:44:21.932 TRACE 18312 --- [           main] o.h.type.descriptor.sql.BasicBinder      : binding parameter [5] as [BIGINT] - [3]

  

 

nexus web配置

 

 

 

 

 

 

 

 

    •  
阿里云Maven中央仓库为里云云效 提供的公共代理仓库,帮助研发人员提高研发生产效率,使用阿里云Maven中央仓库作为下载源,速度更快更稳定。
阿里云云效 是企业级一站式 DevOps 平台,覆盖产品从需求到运营的研发全生命周期,其中云效也提供了免费、可靠的Maven私有仓库 Packages,欢迎您体验使用。

 

 http://repository.apache.org/content/groups/snapshots/?spm=a2c40.maven_devops2020_goldlog_.0.0.43643054AxL62v/