发表于: 2022-04-25 19:11:05

1 655



遇到的问题:

E325: ATTENTION

Found a swap file by the name "/etc/.profile.swp"

          owned by: root   dated: Sun Apr 24 18:21:23 2022

         file name: /etc/profile

          modified: YES

         user name: root   host name: lsFAinWGPZ

        process ID: 1050871

While opening file "/etc/profile"

             dated: Tue Apr  7 07:31:18 2020

(1) Another program may be editing the same file.  If this is the case,

    be careful not to end up with two different instances of the same

    file when making changes.  Quit, or continue with caution.

(2) An edit session for this file crashed.

    If this is the case, use ":recover" or "vim -r /etc/profile"

    to recover the changes (see ":help recovery").

    If you did this already, delete the swap file "/etc/.profile.swp"

    to avoid this message.

Swap file "/etc/.profile.swp" already exists!

[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort: 


发现此处是恢复到上次编辑的地方,可以进入到上次编辑的没有完成的路径。

添加好本地路径之后输入mvn -v命令检测安装是否完成:

执行mvn test命令时候遇到问题:


[INFO] Scanning for projects...

[WARNING] 

[WARNING] Some problems were encountered while building the effective model for org.example:untitled:war:1.0-SNAPSHOT

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: junit:junit:jar -> duplicate declaration of version 4.12 @ line 106, column 17

[WARNING] 

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING] 

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING] 

[INFO] 

[INFO] ------------------------< org.example:untitled >------------------------

[INFO] Building untitled Maven Webapp 1.0-SNAPSHOT

[INFO] --------------------------------[ war ]---------------------------------

[INFO] 

[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory /data/src/main/resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ untitled ---

[INFO] No sources to compile

[INFO] 

[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory /data/src/test/resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ untitled ---

[INFO] No sources to compile

[INFO] 

[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ untitled ---

[INFO] No tests to run.

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  1.050 s

[INFO] Finished at: 2022-04-25T15:33:43+08:00

[INFO] ------------------------------------------------------------------------


pom文件下,junit依赖重复:



 修改后执行:


数据导入错误导致一直报错:

No tests were executed!


更改之后执行命令:

mvn test -Dtest=CalculatorTest

执行结果:

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building untitled Maven Webapp 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ untitled ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 0 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ untitled ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 4 source files to D:\学习文件\JdbcTemplate任务\untitled\target\test-classes

[INFO]

[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ untitled ---

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

四月 25, 2022 6:16:44 下午 org.springframework.test.context.support.AbstractTestContextBootstrapper getDefaultTestExecutionListenerClassNames

信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.co

ntext.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.Dirties

ContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springf

ramework.test.context.event.EventPublishingTestExecutionListener]

四月 25, 2022 6:16:44 下午 org.springframework.test.context.support.AbstractTestContextBootstrapper getTestExecutionListeners

信息: Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@15d0c81b, org.springframework.test.context.support.DependencyInjecti

onTestExecutionListener@6acdbdf5, org.springframework.test.context.support.DirtiesContextTestExecutionListener@4b1c1ea0, org.springframework.test.context.transaction.TransactionalTestExecutionL

istener@17579e0f, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@4d41cee, org.springframework.test.context.event.EventPublishingTestExecutionListener@3712b94]

Running com.cdpowernode.CalculatorTest

100

30

3000

0

四月 25, 2022 6:16:54 下午 com.mchange.v2.log.MLog

信息: MLog clients using java 1.4+ standard logging.

四月 25, 2022 6:16:54 下午 com.mchange.v2.c3p0.C3P0Registry

信息: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.623 sec - in com.cdpowernode.CalculatorTest

Running com.cdpowernode.MisTest

四月 25, 2022 6:16:54 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource

信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTe

stTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 1000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester

, contextClassLoaderSource -> caller, dataSourceName -> 1hge13eaoqp5m3z1ji6jh5|3b69e7d1, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver

, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge13eaoqp5

m3z1ji6jh5|3b69e7d1, idleConnectionTestPeriod -> 0, initialPoolSize -> 100, jdbcUrl -> jdbc:mysql://localhost:3306/fc, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, m

axIdleTimeExcessConnections -> 0, maxPoolSize -> 1000, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 50, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawne

dThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> fa

lse, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]

Dog{id=111111, name='陈某', health=null, love=null, strain='null'}

Dog{id=3333333, name='张三', health=null, love=null, strain='null'}

Dog{id=912757153, name='黄炜杰', health=null, love=null, strain='null'}

Dog{id=912757154, name='黄某', health=null, love=null, strain='null'}

Dog{id=912757155, name='徐牛', health=null, love=null, strain='null'}

Dog{id=912757156, name='黄炜', health=null, love=null, strain='null'}

Dog{id=912757157, name='黄连杰', health=null, love=null, strain='null'}

Dog{id=912757158, name='陈雪', health=null, love=null, strain='null'}

Dog{id=912757159, name='余生', health=null, love=null, strain='null'}

Dog{id=912757160, name='徐晨杰', health=null, love=null, strain='null'}

Dog{id=912757161, name='李四', health=null, love=null, strain='null'}

Dog{id=912757162, name='黄炜杰', health=null, love=null, strain='null'}

Dog{id=912757163, name='黄炜杰', health=null, love=null, strain='null'}

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.188 sec - in com.cdpowernode.MisTest

Results :

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 14.493 s

[INFO] Finished at: 2022-04-25T18:16:56+08:00

[INFO] Final Memory: 18M/235M

[INFO] ------------------------------------------------------------------------

D:\学习文件\JdbcTemplate任务\untitled>mvn test -Dtest=CalculatorTest

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building untitled Maven Webapp 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ untitled ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 0 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ untitled ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 4 source files to D:\学习文件\JdbcTemplate任务\untitled\target\test-classes

[INFO]

[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ untitled ---

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Running com.cdpowernode.CalculatorTest

100

30

3000

0

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in com.cdpowernode.CalculatorTest

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 3.494 s

[INFO] Finished at: 2022-04-25T18:17:19+08:00

[INFO] Final Memory: 18M/237M

[INFO] ------------------------------------------------------------------------

D:\学习文件\JdbcTemplate任务\untitled>mvn test -Dtest=CalculatorTest

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building untitled Maven Webapp 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 1 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ untitled ---

[INFO] Nothing to compile - all classes are up to date

[INFO]

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ untitled ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 0 resource

[INFO]

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ untitled ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 4 source files to D:\学习文件\JdbcTemplate任务\untitled\target\test-classes

[INFO]

[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ untitled ---

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Running com.cdpowernode.CalculatorTest

100

30

3000

0

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in com.cdpowernode.CalculatorTest

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 3.457 s

[INFO] Finished at: 2022-04-25T18:18:18+08:00

[INFO] Final Memory: 18M/238M

[INFO] ------------------------------------------------------------------------


在FinalShell上使用mvn的执行结果:






今天学习到了:

在FinalShell当中安装搭配了maven。

FinalShell使用mvn命令来执行代码。



明天尝试任务24:直接执行Main方法,去在服务器上跑通流程。



返回列表 返回列表
评论

    分享到