kaspersorensen / dotnet-maven-plugin

A Maven plugin for building dotnet projects based on project.json
Apache License 2.0
25 stars 15 forks source link

API KEY argument support to push to a private myget repo #26

Closed charbull closed 6 years ago

charbull commented 6 years ago

Hello,

Is there a way to pass the API KEY argument when pushing to a private myget repo?

Something similar to:

run ..\.nuget\nuget push *.nupkg <API_KEY> -Source https://www.myget.org/F/<FEED_NAME>/api/v2/package

I took a look at the code but not sure where to change in this class

Any suggestions?

Thank you

kaspersorensen commented 6 years ago

Hi there,

No that's currently not supported. I've always just put credentials in the nuget.config file. But I guess we could make a property available in the maven plugin too, so that you can specify it either in pom.xml or via command line. You want to make this contribution maybe?

charbull commented 6 years ago

Hello @kaspersorensen, Sure ! I finally set some time today to add this feature. Couple of questions to you:

For some reason I am able to get the repositoryKey from the helper, I can read it at first but then it is null, Please take a look here

I was wondering if my property was wrong?

    @Parameter(property = "dotnet.repository.key", required = false, defaultValue = "")
    private String repositoryKey;

Thank you for your help, Charbel

charbull commented 6 years ago

Added pull request

kaspersorensen commented 6 years ago

Releasing this with version 0.21

kaspersorensen commented 6 years ago

Correction, I meant version 0.23