- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在从 TeamCity 运行我的代码,它通过告诉我包不存在来编译时遇到问题。
我认为我的代码不在类路径中,因此我需要以不同方式重新配置 Maven。努力寻找有关此的任何信息。
我在下面粘贴我的系统变量和我的 POM:
CLASSPATH = .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
JAVA_HOME = C:\Program Files\Java\jdk-9.0.4
JDK_HOME = %JAVA_HOME%
JRE_HOME = C:\TeamCity\jre
Path = "C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4"\bin;%JAVA_HOME%\bin;other path stuff here
M2_HOME = "C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4"
MAVEN_HOME = "C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4"
POM 在这里:
编辑:我现在为 <testSourceDirectory>
添加了一个值因为这个不见了。但是错误依然存在。
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java8</artifactId>
<version>1.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans-xpath</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.5.2.jre9-preview</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<configuration>
<!-- specify UTF-8, ISO-8859-1 or any other file encoding -->
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<!-- <testClassesDirectory>s360UIAutomationCC/src/main/java</testClassesDirectory> -->
<testSourceDirectory>src/test/java/</testSourceDirectory>
<includes>
<include>**/*MOP_Run_All.java</include>
</includes>
<!-- <excludes> <exclude>**/*RunCukesTest.java</exclude> </excludes> -->
</configuration>
</plugin>
</plugins>
<resources>
</resources>
</build>
<profiles>
</profiles>
</project>
我正在从 TeamCity 添加日志,直到出现错误为止:
[11:59:20]Checking for changes
[11:59:21]Publishing internal artifacts
[11:59:21]Clearing temporary directory: C:\TeamCity\buildAgent2nd\temp\buildTmp
[11:59:21]Checkout directory: C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06
[11:59:21]Updating sources: server side checkout
[11:59:21]Step 1/1: Maven (Maven) (9s)
[11:59:21][Step 1/1] Using watcher: C:\TeamCity\buildAgent2nd\plugins\mavenPlugin\maven-watcher\maven-watcher-agent.jar
[11:59:21][Step 1/1] Initial M2_HOME = C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4
[11:59:21][Step 1/1] Current M2_HOME = C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4
[11:59:21][Step 1/1] PATH = C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\bin;C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\bin;C:\Program Files\Java\jdk-9.0.4\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\bin;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\TortoiseSVN\bin;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\NTP\bin;C:\Ruby22-x64\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\
[11:59:21][Step 1/1] Initial MAVEN_OPTS not set
[11:59:21][Step 1/1] Current MAVEN_OPTS = -Dmaven.multiModuleProjectDirectory="C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4"
[11:59:21][Step 1/1] Starting: "C:\Program Files\Java\jdk-10.0.2\bin\java.exe" "-DDmaven.multiModuleProjectDirectory=C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4" -Dagent.home.dir=C:\TeamCity\buildAgent2nd -Dagent.name=WEBDEVVMWFE2nd -Dagent.ownPort=9094 -Dagent.work.dir=C:\TeamCity\buildAgent2nd\work -Dbuild.number=49 -Dbuild.vcs.number=5045 -Dbuild.vcs.number.1=5045 -Dbuild.vcs.number.SitecoreBdd_TfsHttpMdaRs8080tfsMdaWeb20redevelopmentSitecoreBdd=5045 -Dclassworlds.conf=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.m2.conf -Dcom.jetbrains.maven.watcher.report.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\maven-build-info.xml -Djava.io.tmpdir=C:\TeamCity\buildAgent2nd\temp\buildTmp "-Dmaven.home=C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4" -Dmaven.repo.local=C:/Users/SVC_DevBuildAgent/.m2/repository -Dmdafeedkey=Password1 -Dmdafeedurl=http://webdevvmwfe:8085/nuget/MDA+Feeds -Dnugetfeedkey=Password1 -Dnugetfeedurl=http://webdevvmwfe:8085/nuget/mdathirdparty -Dpath.macro.MAVEN.REPOSITORY=c:/.m2/repository -Dteamcity.agent.cpuBenchmark=274 -Dteamcity.agent.dotnet.agent_url=http://localhost:9094/RPC2 -Dteamcity.agent.dotnet.build_id=10695 -Dteamcity.auth.password=geVIwqNiAoewJuElFUtwaPT6i0ve9Iru -Dteamcity.auth.userId=TeamCityBuildId=10695 -Dteamcity.build.changedFiles.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\changedFiles2607574113103246204.txt -Dteamcity.build.checkoutDir=C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06 -Dteamcity.build.id=10695 -Dteamcity.build.properties.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.build8254433068643114691.properties -Dteamcity.build.tempDir=C:\TeamCity\buildAgent2nd\temp\buildTmp -Dteamcity.build.workingDir=C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06 "-Dteamcity.buildConfName=Build Sitecore BDD" -Dteamcity.buildType.id=SitecoreBdd_Test -Dteamcity.configuration.properties.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.config6252402284421596652.properties -Dteamcity.dotnet.nunitaddin=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit -Dteamcity.dotnet.nunitlauncher=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe -Dteamcity.dotnet.nunitlauncher.msbuild.task=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll -Dteamcity.dotnet.nunitlauncher1.1=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe -Dteamcity.dotnet.nunitlauncher2.0=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe -Dteamcity.dotnet.nunitlauncher2.0.vsts=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe -Dteamcity.dotnet.platform=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe -Dteamcity.maven.watcher.home=C:\TeamCity\buildAgent2nd\plugins\mavenPlugin\maven-watcher "-Dteamcity.projectName=Sitecore BDD" -Dteamcity.runner.properties.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.runner5425832831152215119.properties -Dteamcity.tests.recentlyFailedTests.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\testsToRunFirst2496520396488952225.txt "-Dteamcity.version=8.0.6 (build 27767)" "-Dmaven.multiModuleProjectDirectory=\"C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\"" -classpath "C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\boot\plexus-classworlds-2.5.2.jar;" org.codehaus.plexus.classworlds.launcher.Launcher -f "C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06\MDA Online Framework\pom.xml" -B clean test -DtposUrl=https://tpos-dev.mdanational.com.au/ -DmosURL=https://mos-dev.mdanational.com.au -DmopURL=https://mop-dev.mdanational.com.au/ -DadawaURL=https://adawa-dev.mdanational.com.au/ -DdplURL=https://dpl-dev.mdanational.com.au/ -DoaURL=https://oa-dev.mdanational.com.au/ -DdbPivotalDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver -DdbPivotalURL=jdbc:sqlserver://MDAPDCDBS11:1433; -DdbPivotalName=databaseName=MDA-DevelopmentED
[11:59:21][Step 1/1] in directory: C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06
[11:59:25][Step 1/1] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
[11:59:25][Step 1/1] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[11:59:25][Step 1/1] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - ----------------------< com.mycompany.app:my-app >----------------------
[11:59:25][Step 1/1] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building my-app 1
[11:59:25][Step 1/1] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --------------------------------[ jar ]---------------------------------
[11:59:25][Step 1/1] com.mycompany.app:my-app (5s)
[11:59:25][com.mycompany.app:my-app] Importing data from 'C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/target/surefire-reports/TEST-*.xml' (not existing file) with 'surefire' processor
[11:59:25][com.mycompany.app:my-app] Surefire report watcher
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-clean-plugin:2.5:clean (default-clean) @ my-app ---
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.plugin.clean.CleanMojo - Deleting C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06\MDA Online Framework\target
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.3:resources (default-resources) @ my-app ---
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Using 'UTF-8' encoding to copy filtered resources.
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 2 resources
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[11:59:26][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.3:compile (default-compile) @ my-app ---
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.plugin.compiler.CompilerMojo - Nothing to compile - all classes are up to date
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-resources-plugin:2.3:testResources (default-testResources) @ my-app ---
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Using 'UTF-8' encoding to copy filtered resources.
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering - Copying 8 resources
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger -
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ my-app ---
[11:59:27][com.mycompany.app:my-app] [main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - Changes detected - recompiling the module!
[11:59:27][com.mycompany.app:my-app] [main] INFO org.codehaus.plexus.compiler.javac.JavacCompiler - Compiling 27 source files to C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06\MDA Online Framework\target\test-classes
[11:59:30][com.mycompany.app:my-app] [main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - -------------------------------------------------------------
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - COMPILATION ERROR :
[11:59:30][com.mycompany.app:my-app] [main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - -------------------------------------------------------------
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - /C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/src/test/java/stepdefs/MOPStepDefs/MOPStepDefs.java:[5,14] package config does not exist
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - /C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/src/test/java/Database/GetDatabase.java:[3,14] package config does not exist
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - /C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/src/test/java/stepdefs/TPOSStepDefs/TPOStepDefs.java:[5,14] package config does not exist
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - /C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/src/test/java/stepdefs/OAStepDefs/OAStepDefs.java:[7,14] package config does not exist
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - /C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/src/test/java/stepdefs/MOSStepDefs/MOSStepDefs.java:[6,14] package config does not exist
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - /C:/TeamCity/buildAgent2nd/work/bf68b71269ca1c06/MDA Online Framework/src/test/java/stepdefs/MOPStepDefs/MOPStepDefs.java:[35,24] cannot find symbol
下面是 TeamCity 运行的命令:
"C:\Program Files\Java\jdk-10.0.2\bin\java.exe" "-DDmaven.multiModuleProjectDirectory=C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4" -Dagent.home.dir=C:\TeamCity\buildAgent2nd -Dagent.name=WEBDEVVMWFE2nd -Dagent.ownPort=9094 -Dagent.work.dir=C:\TeamCity\buildAgent2nd\work -Dbuild.number=49 -Dbuild.vcs.number=5045 -Dbuild.vcs.number.1=5045 -Dbuild.vcs.number.SitecoreBdd_TfsHttpMdaRs8080tfsMdaWeb20redevelopmentSitecoreBdd=5045 -Dclassworlds.conf=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.m2.conf -Dcom.jetbrains.maven.watcher.report.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\maven-build-info.xml -Djava.io.tmpdir=C:\TeamCity\buildAgent2nd\temp\buildTmp "-Dmaven.home=C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4" -Dmaven.repo.local=C:/Users/SVC_DevBuildAgent/.m2/repository -Dmdafeedkey=Password1 -Dmdafeedurl=http://webdevvmwfe:8085/nuget/MDA+Feeds -Dnugetfeedkey=Password1 -Dnugetfeedurl=http://webdevvmwfe:8085/nuget/mdathirdparty -Dpath.macro.MAVEN.REPOSITORY=c:/.m2/repository -Dteamcity.agent.cpuBenchmark=274 -Dteamcity.agent.dotnet.agent_url=http://localhost:9094/RPC2 -Dteamcity.agent.dotnet.build_id=10695 -Dteamcity.auth.password=geVIwqNiAoewJuElFUtwaPT6i0ve9Iru -Dteamcity.auth.userId=TeamCityBuildId=10695 -Dteamcity.build.changedFiles.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\changedFiles2607574113103246204.txt -Dteamcity.build.checkoutDir=C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06 -Dteamcity.build.id=10695 -Dteamcity.build.properties.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.build8254433068643114691.properties -Dteamcity.build.tempDir=C:\TeamCity\buildAgent2nd\temp\buildTmp -Dteamcity.build.workingDir=C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06 "-Dteamcity.buildConfName=Build Sitecore BDD" -Dteamcity.buildType.id=SitecoreBdd_Test -Dteamcity.configuration.properties.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.config6252402284421596652.properties -Dteamcity.dotnet.nunitaddin=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit -Dteamcity.dotnet.nunitlauncher=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe -Dteamcity.dotnet.nunitlauncher.msbuild.task=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll -Dteamcity.dotnet.nunitlauncher1.1=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe -Dteamcity.dotnet.nunitlauncher2.0=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe -Dteamcity.dotnet.nunitlauncher2.0.vsts=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe -Dteamcity.dotnet.platform=C:\TeamCity\buildAgent2nd\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe -Dteamcity.maven.watcher.home=C:\TeamCity\buildAgent2nd\plugins\mavenPlugin\maven-watcher "-Dteamcity.projectName=Sitecore BDD" -Dteamcity.runner.properties.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\teamcity.runner5425832831152215119.properties -Dteamcity.tests.recentlyFailedTests.file=C:\TeamCity\buildAgent2nd\temp\buildTmp\testsToRunFirst2496520396488952225.txt "-Dteamcity.version=8.0.6 (build 27767)" "-Dmaven.multiModuleProjectDirectory=\"C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\"" -classpath "C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\boot\plexus-classworlds-2.5.2.jar;" org.codehaus.plexus.classworlds.launcher.Launcher -f "C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06\MDA Online Framework\pom.xml" -B clean test -DtposUrl=https://xxxxxxxx.com.au/ -DmosURL=https://xxxxx.com.au -DmopURL=https://xxxx.com.au/ -DadawaURL=https://xxxx.com.au/ -DdplURL=https://xxxxx.com.au/ -DoaURL=https://xxxxxx.com.au/ -DdbPivotalDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver -DdbPivotalURL=jdbc:sqlserver://xxxx:9999; -DdbPivotalName=databaseName=xxx-xxxxopmentED
同时在项目结构中添加:
MDA Online Framework
├───.idea
│ ├───dictionaries
│ └───libraries
├───Maven
│ └───apache-maven-3.5.4
│ ├───bin
│ ├───boot
│ ├───conf
│ │ └───logging
│ └───lib
│ ├───ext
│ └───jansi-native
│ ├───freebsd32
│ ├───freebsd64
│ ├───linux32
│ ├───linux64
│ ├───osx
│ ├───windows32
│ └───windows64
├───Reporting
│ ├───ADAWA
│ ├───DPL
│ ├───MOP
│ ├───MOS
│ ├───OA
│ ├───TPOS
│ └───wikipedia.html
├───run
├───Selenium
│ └───libs
├───src
│ ├───main
│ │ ├───java
│ │ └───resources
│ └───test
│ ├───java
│ │ ├───config
│ │ ├───Database
│ │ ├───Pages
│ │ └───stepdefs
│ │ ├───MOPStepDefs
│ │ ├───MOSStepDefs
│ │ ├───OAStepDefs
│ │ └───TPOSStepDefs
│ └───Resources
│ ├───MOP Features
│ ├───MOS Features
│ ├───Online Apps
│ └───TPOS
└───target
├───classes
├───generated-sources
│ └───annotations
├───generated-test-sources
│ └───test-annotations
├───maven-status
│ └───maven-compiler-plugin
│ ├───compile
│ │ └───default-compile
│ └───testCompile
│ └───default-testCompile
├───surefire-reports
└───test-classes
├───config
├───Database
├───MOP Features
├───MOS Features
├───Online Apps
├───Pages
├───stepdefs
│ ├───MOPStepDefs
│ ├───MOSStepDefs
│ ├───OAStepDefs
│ └───TPOSStepDefs
└───TPOS
我的类 MDABDDConfig 位于包 MDA Online Framework\src\test\java\config 下,该类的内容如下:
package config;
public class MDABDDConfig {
public static String getTposUrl() {
return System.getProperty("tposUrl");
}
public static String getMosUrl() {
return System.getProperty("mosURL");
}
我的 Step def 类(错误日志中提到的位置)将调用此类,例如:
//get URL from properties Class
String strMOSurl = MDABDDConfig.getMosUrl();
从那以后,我注意到 TeamCity 仅在我的 src/test/resources 文件夹下选取类,而没有从我的 src/test/java 文件夹中选取任何内容。这基本上是导致此问题的原因,但我不知道如何解决。
最佳答案
根据您分享的错误日志,您关注的是错误的问题。失败的是测试类的编译而不是执行!
[11:59:27][com.mycompany.app:my-app] [main] INFO org.codehaus.plexus.compiler.javac.JavacCompiler - Compiling 27 source files to C:\TeamCity\buildAgent2nd\work\bf68b71269ca1c06\MDA Online Framework\target\test-classes
[11:59:30][com.mycompany.app:my-app] [main] INFO org.apache.maven.plugin.compiler.TestCompilerMojo - -------------------------------------------------------------
[11:59:30][com.mycompany.app:my-app] [main] ERROR org.apache.maven.plugin.compiler.TestCompilerMojo - COMPILATION ERROR :
从报告的路径中,我可以看到它在提示包 config
不存在。编译器使用的目录布局与目录树中显示的不完全相同。
src/test/java/stepdefs/MOPStepDefs/MOPStepDefs.java:[5,14] package config does not exist
关于java - Maven 在构建时找不到我的测试测试类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51760002/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!