UnquietCode / JCodeModel

Fork of the com.sun.codemodel project from the java.net / GlassFish
Other
12 stars 5 forks source link

Can't build JCodeModel without special properties set #15

Open mattbishop opened 8 years ago

mattbishop commented 8 years ago

I don't have these in my environment: ossrhUsername, ossrhPassword. I shouldn't need them to test JCodeModel locally.

UnquietCode commented 8 years ago

Yeah, good point. There should be a command line flag.

mattbishop commented 8 years ago

I'm doing this: ./gradlew test -P ossrhUsername=matt -P ossrhPassword=password

hyleung commented 8 years ago

@UnquietCode this may or not be helpful - sort of depends on how you release the library. For one of my projects, I do something like this in my build.gradle:

/**
 * Set the credentials from ENV variables.
 */
def repoUserName = System.getenv("SONATYPE_USER")
def repoPassword = System.getenv("SONATYPE_PASSWORD")

Then for my maven deployer plugin:

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
    authentication(userName: "${repoUserName}", password: "${repoPassword}")
}

Should be able to build the library locally at that point (you just can't publish artifacts).

I use TravisCI to publish my artifacts, so I can use the Travis CLI tools to encrypt these variables.