athieriot / drone-artifactory

Drone plugin for publishing build artifacts to Artifactory
Apache License 2.0
10 stars 12 forks source link

Simplify configuration required to upload maven artifacts #6

Closed a-buck closed 8 years ago

a-buck commented 8 years ago

Hi there,

I was wondering if we could simplify the use of the artifactory plugin for uploading maven artifacts. With maven I could run:

mvn deploy

Maven would look at the pom, build the jar and upload the pom.xml and jar to artifactory.

With the artifactory plugin, I have to specify:

artifactory:
      url: my_companies_artifactory.com
      username: $$username
      password: $$password
      pom: pom.xml
      force_upload: true
      files:
        - pom.xml
        - target/*.jar

Could the plugin be updated so theoretically all that is required is:

artifactory:
      url: my_companies_artifactory.com
      username: $$username
      password: $$password
      pom: pom.xml
      force_upload: true

or if the jar is packaged to a non standard location perhaps:

artifactory:
      url: my_companies_artifactory.com
      username: $$username
      password: $$password
      pom: pom.xml
      force_upload: true
      jar: target/custom_directory/executable.jar

This would reduce the risk of anyone forgetting to upload the pom.xml along with the artifact as well as making it easier to use.

I would be happy to have a go at implementing this if you think it's a worthwhile thing to do.

athieriot commented 8 years ago

Hi there,

It's quite a good idea. Let's me resume. Would it be enough to:

I would like to keep the files property instead of jar if you don't mind cause I use the plugin a lot for war as well and all sorts of -sources- and -doc-

What we could do as well is to accept a single entry for it as well as a list.

What do you think?

a-buck commented 8 years ago

Hi @athieriot, thanks for the comments. I think that's reasonable. I'd like to have a go at this but will wait till your pull request is merged as i think conflicts would be likely due to the amount of refactoring

Thanks!

athieriot commented 8 years ago

Thank you !

a-buck commented 8 years ago

Hi @athieriot, I've raised pull request #7

On reflection I don't think it's worth adding a default value for target/*.jar....it's not functionality i need at the moment either. What do you think? I think it's a bit of a specific scenario and assumes that the user is using maven rather than being build tool agnostic.

athieriot commented 8 years ago

If it's something you don't really need then I think you are right.

Even, I would be quite curious to see if the plugin, in its current state, is working fine with non-Maven artefacts