pom.xml을 통해 testng.xml 파일을 실행하려고하지만 제공하고 있습니다. 그러나 testng.xml은 testng suite로 실행하면 정상적으로 작동합니다. 내가 얻는 오류는 다음과 같다. (콘솔 전체를 붙이기 위해 유감스럽게 생각하지만 기회를 얻고 싶지 않았다.) 내가 받는다는 종속성에서 SLF4J-NOP-1.7.5.jar를 확장하면maven을 통해 testng.xml을 실행하면 오류가 발생합니다.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myproj 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.seleniumhq.selenium:selenium-server-standalone:jar:2.33.0 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ myproj ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ myproj ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ myproj ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ myproj ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.4.2:test (default-test) @ myproj ---
[INFO] Surefire report directory: D:\workspace\myproj\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
org.apache.maven.surefire.booter.SurefireExecutionException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 17; Open quote is expected for attribute "{1}" associated with an element type "name".; nested exception is org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 17; Open quote is expected for attribute "{1}" associated with an element type "name".
org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 17; Open quote is expected for attribute "{1}" associated with an element type "name".
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:341)
at org.testng.TestNG.run(TestNG.java:1030)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 17; Open quote is expected for attribute "{1}" associated with an element type "name".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10)
at org.testng.xml.Parser.parse(Parser.java:172)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311)
... 10 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.826s
[INFO] Finished at: Wed Jul 03 20:15:45 IST 2013
[INFO] Final Memory: 8M/107M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test (default-test) on project myproj: There are test failures.
[ERROR]
[ERROR] Please refer to D:\workspace\myproj\target\surefire-reports for the individual test results.
[ERROR] -> [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/MojoFailureException
나는이 클래스가 있음을 관찰하지만이과의 pom.xml에서 제대로 언급하면 이해가 안 돼요 왜로드에 실패했는지보다. 제가 누락 된 부분을 알려주십시오.
의 pom.xml입니다 : 내가 바로 클릭하고 (w/목표를 지정 O) 메이븐 테스트로 실행하고 메이븐 빌드 시도했지만이 같은 오류를주는 유지 운이 없어
<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.myproj.tests</groupId>
<artifactId>myproj</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>myproj</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>2.33.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- TestNG-xslt related configuration. -->
<plugin>
<groupId>org.testng.xslt</groupId>
<artifactId>testng-xslt-plugin</artifactId>
<version>1.1</version>
<configuration>
<!-- Output directory for the report -->
<outputDir>${project.basedir}/target/testng-xslt-report</outputDir>
<sortTestCaseLinks>true</sortTestCaseLinks>
<testDetailsFilter>FAIL,SKIP,PASS,CONF,BY_CLASS</testDetailsFilter>
<showRuntimeTotals>true</showRuntimeTotals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</reporting>
<pluginRepositories>
<pluginRepository>
<id>testng-xslt-plugin</id>
<url>http://www.cosminaru.ro/maven/</url>
</pluginRepository>
</pluginRepositories>
</project>
나는 단지 경고 일 뿐이라고 생각한다. 프로젝트 라인을 스캔 한 후 어떻게 될까? –
@niharika_neo가 내가 가지고있는 오류를 편집했습니다. 그것은 내가 자원 디렉토리를 가지고 있지 않다고 말했기 때문에, 나는 하나 (빈)를 만들었다. – paul