在封闭的环境中无法在jenkins上运行maven

时间:2016-06-15 06:21:43

标签: maven jenkins

我正在尝试使用maven on jenkins(1.651.2)为windows运行一个简单的构建。我正在一个没有互联网连接的封闭环境。在我的互联网电脑上尝试相同的工作正常。同样从命令行一切正常jenkins我得到这个错误:

Building on master in workspace C:\source\maven
ERROR: Failed to parse POMs
java.net.MalformedURLException: no protocol: 
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at hudson.tools.ZipExtractionInstaller.performInstallation(ZipExtractionInstaller.java:79)
        at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:68)
        at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:108)
        at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
        at hudson.model.JDK.forNode(JDK.java:143)
        at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:357)
        at hudson.model.Run.getEnvironment(Run.java:2229)
        at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:938)
        at hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56)
        at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:166)
        at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:622)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
        at hudson.model.Run.execute(Run.java:1738)
        at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

添加我的简单程序pom文件:

<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/maven-v4_0_0.xsd">    
  <modelVersion>4.0.0</modelVersion>    
  <groupId>com.mycompany.app</groupId>    
  <artifactId>my-app</artifactId>    
  <packaging>jar</packaging>    
  <version>1.0-SNAPSHOT</version>    
  <name>my-app</name>    
  <url>http://maven.apache.org</url>    
  <dependencies>    
    <dependency>    
      <groupId>junit</groupId>    
      <artifactId>junit</artifactId>    
      <version>3.8.1</version>    
      <scope>test</scope>    
    </dependency>    
  </dependencies>    
</project>

2 个答案:

答案 0 :(得分:1)

看起来Jenkins正在尝试自动安装maven,如果您有类似的内容(自动安装),请检查配置页:

enter image description here

如果是这样,请取消选中该框并提供maven安装的路径,如果您在jenkins用户的PATH中有maven,请将其留空。

答案 1 :(得分:0)

谢谢krzyk 问题不在于设置为krzyk的maven部分建议问题出在jdk部分,其中有#34;自动安装&#34;检查。错误消息不清楚