jcabi / jcabi-beanstalk-maven-plugin

Maven Plugin for AWS Elastic Beanstalk
http://beanstalk.jcabi.com/
Other
11 stars 10 forks source link

plugin failing when using (sub)folders in an S3 bucket #37

Open alan-czajkowski opened 7 years ago

alan-czajkowski commented 7 years ago

For additional commentary, see: https://github.com/jcabi/jcabi/issues/141

Consider this plugin configuration:

<configuration>
  <server>aws.amazon.com</server>
  <name>${project.artifactId}</name> <!-- value: artifact-id -->
  <bucket>${project.groupId}</bucket> <!-- value: com.example -->
  <key>${project.artifactId}/${project.version}</key> <!-- value: artifact-id/1.0.0-SNAPSHOT -->
  <template>${project.artifactId}</template>
</configuration>

So, a) I've created an S3 bucket named after my project's group ID b) I've created a folder in this S3 bucket named after my project's artifact ID c) deploying fails because the plugin makes an assumption that the S3 key should also be considered as the versionLabel for deployment ... ?

Would it be possible to add a config param to the plugin to allow explicit defining of the versionLabel?

See the following error:

[INFO] S3 object 'artifact-id/1.0.0-SNAPSHOT' not found in 'com.example' bucket
[INFO] Uploading /.../artifact-id/target/artifact-id-1.0.0-SNAPSHOT.war (54 MB) to s3://com.example/artifact-id/1.0.0-SNAPSHOT... (may take a few minutes)
[INFO] Uploaded successfully to S3, etag=8dd6a3dbbf0289ec14da4b0fac03af04, expires=null, exp.rule=null, encryption=null, version=null
[INFO] Deployment took 3min
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:20.700s
[INFO] Finished at: Tue Feb 26 17:57:04 EST 2013
[INFO] Final Memory: 20M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jcabi:jcabi-beanstalk-maven-plugin:0.7.8:deploy (default) on project artifact-id: Execution default of goal com.jcabi:jcabi-beanstalk-maven-plugin:0.7.8:deploy failed: 1 validation error detected: Value 'artifact-id/1.0.0-SNAPSHOT' at 'versionLabel' failed to satisfy constraint: Member must satisfy regular expression pattern: [^/]+

Additional comments pasted from: https://github.com/jcabi/jcabi/issues/141

dmarkov commented 7 years ago

@yegor256 please pay attention to this issue (par.21)

yegor256 commented 7 years ago

@alan-czajkowski seems like a bug, you're right. Can you please run Maven with --errors flag and post the stacktrace here? This will help me solve the problem faster. Thanks.