【问题标题】:Maven: Unable to scan the projects and execute from CMD or EclipseMaven:无法扫描项目并从 CMD 或 Eclipse 执行
【发布时间】:2018-12-30 14:35:07
【问题描述】:

我创建了一个 Maven 项目来运行我的自动化脚本。当我尝试从 CMD 或 eclipse 运行时,我看到下面的日志跟踪,但项目没有被执行。请让我知道问题出在哪里。也找到我项目的pom.xml

我正在使用 Java 和 Selenium 运行自动化脚本并创建 Maven 项目以与 Jenkins 集成。

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< Epic2Maven:Epic2Maven >-----------------------  
[INFO] Building Epic2KSA 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.jenkins-ci.plugins.workflow:workflow-step- 
api:jar:1.15
is missing, no dependency information available
[WARNING] The POM for org.kohsuke:groovy-sandbox:jar:1.10 is missing, no 
dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
Epic2Maven
---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered 
resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Epic2Maven -- 
-
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
Epic2Maven ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered 
resources,
i.e. build is platform dependent!
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
Epic2Mven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Epic2Maven ---
[INFO] ---------------------------------------------------------------------- 
 --
[INFO] BUILD SUCCESS
[INFO] ---------------------------------------------------------------------- 
 --
[INFO] Total time: 1.529 s
[INFO] Finished at: 2018-07-23T11:29:13+04:00
[INFO] ---------------------------------------------------------------------- 
  --

Pom.XML

<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>Epic2Maven</groupId>
  <artifactId>Epic2Maven</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Epic2KSA</name>
  <description>Epic2Maven</description>

  <dependencies> 
 <dependency> 
 <groupId>junit</groupId> 
 <artifactId>junit</artifactId>
 <version>4.12</version> 
 <scope>test</scope> </dependency> 
 <dependency>
 <groupId>org.seleniumhq.selenium</groupId> 
 <artifactId>selenium-java</artifactId>
 <version>2.53.0</version>
 </dependency>

 <dependency>
 <groupId>info.cukes</groupId>
 <artifactId>cucumber-java</artifactId>
 <version>1.2.4</version> 
 <scope>test</scope>
 </dependency> 

 <dependency> 
 <groupId>info.cukes</groupId> 
 <artifactId>cucumber-junit</artifactId> 
 <version>1.2.4</version>
 <scope>test</scope>
 </dependency> 

 <dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.5</version>
</dependency>


    <dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports</artifactId>
    <version>3.0.6</version>
    <scope>provided</scope>
</dependency>



 <dependency>
    <groupId>com.vimalselvam</groupId>
    <artifactId>cucumber-extentsreport</artifactId>
    <version>3.0.1</version>
</dependency>

<dependency>
    <groupId>org.freemarker</groupId>
    <artifactId>freemarker</artifactId>
    <version>2.3.23</version>
</dependency>

<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>bson</artifactId>
    <version>3.2.2</version>
</dependency>

<dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.6</version>
</dependency>


<dependency>
    <groupId>ojdbc14</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.3.0</version>
</dependency>

 <dependency>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>scm-api</artifactId>
    <version>1.1</version>

</dependency>
<dependency>
    <groupId>org.jenkins-ci.plugins.workflow</groupId>
    <artifactId>workflow-job</artifactId>
    <version>2.1</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>org.jenkins-ci.plugins.workflow</groupId>
    <artifactId>workflow-support</artifactId>
    <version>2.2</version>
    <scope>test</scope>
</dependency>


<dependency>
    <groupId>org.jenkins-ci.plugins.workflow</groupId>
    <artifactId>workflow-step-api</artifactId>
    <version>2.2</version>
</dependency>

<dependency>
    <groupId>org.apache.maven.wagon</groupId>
    <artifactId>wagon-provider-api</artifactId>
    <version>1.0-beta-2</version>
</dependency>

<dependency>
    <groupId>org.apache.maven.wagon</groupId>
    <artifactId>wagon-file</artifactId>
    <version>1.0-beta-2</version>
</dependency>


<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.5</version>
</dependency>

 </dependencies> 

  </project>

新日志

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< Epic2Maven:Epic2Maven >------------------------
[INFO] Building Epic2KSA 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Epic2Maven
 ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Epic2Maven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Ep
ic2Maven ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Epic2Ma
ven ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Epic2Maven ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.711 s
[INFO] Finished at: 2018-07-23T14:17:33+04:00

【问题讨论】:

  • 首先删除所有包含&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; 的依赖项,因为它没有意义。此外删除&lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt; ..为什么你对org.jenkins-ci.plugins.*有依赖?

标签: eclipse maven pom.xml


【解决方案1】:

您的 jenkins 和 groovy jar 未下载到您的 C:\Users\username.m2\repository\org 文件夹 这就是您收到此错误的原因 你的

workflow-step-api-1.15.jar

jar 应该存在于 C:\Users\username\.m2\repository\org\jenkins-ci\plugins\workflow文件夹

groovy-sandbox-1.10.jar

应该出现在 C:\Users\username\.m2\repository\org\kohsuke文件夹

尝试为这些依赖项使用其他一些 maven 版本或手动下载这些 jar 并将它们放在上述文件夹结构中。

希望对你有所帮助。

【讨论】:

  • 我放置了 jar 文件,但仍然看到相同的日志。该项目没有被选中
  • 正在使用“mvn clean install”来构建,或者您直接先使用eclipse清理然后安装它。您要运行什么?
  • 我正在使用 mvn 全新安装。尝试运行 selenium cucumber 脚本
  • 你可以看看这个帖子stackoverflow.com/questions/2021771/…它可能对你有帮助
猜你喜欢
  • 1970-01-01
  • 2014-07-15
  • 2016-02-25
  • 1970-01-01
  • 2017-05-18
  • 2014-12-23
  • 2018-10-20
  • 2021-04-09
  • 2015-06-30
相关资源
最近更新 更多