2014-01-06 33 views
0

我想配置Bamboo CI服务器来构建项目。我正在使用maven资源插件来复制资源。在我的本地机器上构建成功,但是当我试图通过Amazon EC2上的竹弹性代理构建它时,它会引发“权限被拒绝”错误。竹与弹性代理+ maven给予权限被拒绝错误

的pom.xml(删除了依赖关系,因为它是非常大名单)

 <project > 
    <modelVersion>4.0.0</modelVersion> 
    <groupId></groupId> 
    <artifactId>portalogue</artifactId> 
    <packaging>war</packaging> 
    <version></version> 
    <name></name> 
    <url></url> 


    <build> 
      <plugins> 
       <plugin> 
         <groupId>org.apache.tomcat.maven</groupId> 
         <artifactId>tomcat7-maven-plugin</artifactId> 
         <version>2.1</version> 
         <configuration> 
          <url></url> 
          <server>TomcatServer</server> 
          <path>/portalogue1</path> 
          <username>admin</username> 
          <password>admin</password> 
         </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-resources-plugin</artifactId> 
      <version>2.6</version> 
      <executions>  
       <execution> 
        <id>copy-hbm.xml-to-folder</id> 
        <phase>Build</phase> 
        <goals> 
         <goal>copy-resources</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <outputDirectory>${user.home}/myapp/portalogue/target/portalogue1/WEB-INF/classes/com/xti/portalogue/application/db/hibernate</outputDirectory> 
       <resources> 
        <resource> 
         <directory>${user.home}/myapp/portalogue/src/main/java/com/xti/portalogue/application/db/hibernate</directory> 
         <includes> 
          <include>**/*.hbm.xml</include> 
         </includes> 
        </resource> 
       </resources> 
      </configuration> 
     </plugin> 
    </plugins> 

     <finalName>portalogue1</finalName> 
</build> 

<reporting> 
    <plugins> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>findbugs-maven-plugin</artifactId> 
     <version>2.5.3</version> 
     <configuration> 
      <effort>Max</effort> 
      <threshold>Low</threshold> 
      <xmlOutput>true</xmlOutput> 
    <xmlOutputDirectory>${user.home}/outPutReports</xmlOutputDirectory> 
     </configuration> 
     </plugin> 
     </plugins> 
</reporting> 

</project> 

这我是从竹获取日志如下所示。

build 06-Jan-2014 18:55:19 [INFO] BUILD FAILURE 
build 06-Jan-2014 18:55:19 [INFO] ------------------------------------------------------------------------ 
build 06-Jan-2014 18:55:19 [INFO] Total time: 0.554s 
build 06-Jan-2014 18:55:19 [INFO] Finished at: Mon Jan 06 08:25:19 UTC 2014 
build 06-Jan-2014 18:55:19 [INFO] Final Memory: 3M/15M 
build 06-Jan-2014 18:55:19 [INFO] ------------------------------------------------------------------------ 
build 06-Jan-2014 18:55:19 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project portalogue: Cannot create resource output directory: /home/bamboo/myapp/portalogue/target/portalogue1/WEB-INF/classes/com/xti/portalogue/application/db/hibernate -> [Help 1] 
build 06-Jan-2014 18:55:19 [ERROR] 
build 06-Jan-2014 18:55:19 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
build 06-Jan-2014 18:55:19 [ERROR] Re-run Maven using the -X switch to enable full debug logging. 
build 06-Jan-2014 18:55:19 [ERROR] 
build 06-Jan-2014 18:55:19 [ERROR] For more information about the errors and possible solutions, please read the following articles: 
build 06-Jan-2014 18:55:19 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 
simple 06-Jan-2014 18:55:19 Failing task since return code of [/opt/maven-3.0/bin/mvn --batch-mode -Djava.io.tmpdir=/tmp/MAV-POR-CCB process-resources] was 1 while expected 0 
simple 06-Jan-2014 18:55:19 Finished task 'Process Resources' 
simple 06-Jan-2014 18:55:19 Running post build plugin 'Artifact Copier' 
simple 06-Jan-2014 18:55:19 Running post build plugin 'NCover Results Collector' 
simple 06-Jan-2014 18:55:19 Running post build plugin 'Clover Results Collector' 
simple 06-Jan-2014 18:55:19 Finalising the build... 
simple 06-Jan-2014 18:55:19 Stopping timer. 
simple 06-Jan-2014 18:55:19 Build MAV-POR-CCB-23 completed. 

如果有人知道发生了什么问题,请让我知道。

+0

您应该检查:' $ {user.home}/myapp/portalogue/target /'导致user.home在Maven构建中不是一个好主意。只需将'.hbm.xml'放到'src/main/resources /'文件夹中,它们就会自动复制。 – khmarbaise

+0

谢谢khmarbaise。我厌倦了将hbm.xml文件保留在那里。但它没有被复制到目标文件夹中的所需文件夹。所以,我使用这个插件将文件复制到所需的文件夹。 – Anup

回答

0

您可以登录到您的弹性实例,将用户切换到竹(竹)运行的用户,然后尝试制作您指定的目录。可能它是一个受限制的路径。

基本上是: 寻找ssh键和竹子实例的IP,登录,则:

苏竹

的mkdir /家用/竹/ MYAPP/portalogue /目标/ portalogue1/WEB-INF /类/ COM/XTI/portalogue /应用/数据库/休眠

或者在此之前,你可以登录到竹/弹性实例并执行maven的目标对自己与-EX开关,检查什么样的详细的错误信息它给你。

+0

我确实在本地机器上创建了所需的文件夹结构,并且它在没有资源插件的情况下对本地工作正常。现在,当我尝试更改EC2实例上的文件夹结构时,无法删除以前的文件。可能是许可问题。任何人都可以帮助我解决这个问题? – Anup

+0

正如我所说的,登录到amazon实例并尝试与竹用户创建文件夹结构。不要在本地尝试东西,只需登录到EC2,将用户切换到竹用户,然后尝试制作该目录。 –