Giter Site home page Giter Site logo

jfrog / artifactory-client-java Goto Github PK

View Code? Open in Web Editor NEW
316.0 316.0 153.0 1.71 MB

Artifactory REST Client Java API bindings

License: Apache License 2.0

Java 68.80% Groovy 31.20%
artifactory artifactory-java-client java jfrog jfrog-artifactory jfrog-xray xray

artifactory-client-java's People

Contributors

ajeans avatar alexpits avatar alextu avatar attiasas avatar axel3rd avatar banadiga avatar barbelity avatar charlesk40 avatar dodie avatar elig avatar eyalb4doc avatar eyalbe4 avatar freddy33 avatar fritaly avatar ihortheglyph avatar jbaruch avatar jeka1978 avatar liorhson avatar matankatz avatar omerkarj avatar omersalman17 avatar robinino avatar sailingcat avatar shikloshi avatar shivaraman83 avatar tmayost avatar ttetzlaff avatar vacuumn avatar yahavi avatar yoav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

artifactory-client-java's Issues

Usable in Scala?

I am using the client within a Scala 2.10 application but getting the following error on ArtifactoryClient.create. Just curious what the cause could be and if there are issues with using the client in Scala or different JDK's. Thanks.

java.lang.UnsupportedClassVersionError: org/codehaus/groovy/runtime/XmlGroovyMethods : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule.newModule(MetaInfExtensionModule.java:72)
at org.codehaus.groovy.runtime.m12n.StandardPropertiesModuleFactory.newModule(StandardPropertiesModuleFactory.java:48)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerExtensionModuleFromProperties(MetaClassRegistryImpl.java:179)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerExtensionModuleFromMetaInf(MetaClassRegistryImpl.java:174)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerClasspathModules(MetaClassRegistryImpl.java:156)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:111)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:73)
at groovy.lang.GroovySystem.(GroovySystem.java:33)
at org.codehaus.groovy.runtime.InvokerHelper.(InvokerHelper.java:62)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.findRegex(ScriptBytecodeAdapter.java:715)
at org.jfrog.artifactory.client.ArtifactoryClient.create(ArtifactoryClient.groovy:16)

Dependency on ch.qos.logback:logback-classic:1.0.9

Please remove the compile dependency on ch.qos.logback:logback-classic jar file.

A work around is for the user to create a logback.xml file to block debug level messages before moving to production, but slf4j has better solutions.

Limited support for running execution plugins

There doesn't seem to be a way to specify which http method to use when calling an execution plugin. It just uses POST, even though some plugins may be set up to only use GET or something.

Also, there doesn't seem to be a way to attach a request body to an execution plugin, so I can't use this library to call plugins that take a body parameter.

repositoryHandle.get() fails for “java.net.m1” repo

Hi,

I don’t think we have changed anything on “java.net.m1” repository, but following call fails:

RepositoryHandle repositoryHandle = artifactory.repository("java.net.m1");
repository = repositoryHandle.get();   <== exception here

All other repositories works fine, just on “java.net.m1”

Repository Info:

curl -H "Authorization: Basic <AUTH>" http://<artifactory-server>/artifactory/api/repositories/java.net.m1
{
  "key" : "java.net.m1",
  "description" : "java.net Maven1 Format",
  "notes" : "",
  "includesPattern" : "**/*",
  "excludesPattern" : "",
  "repoLayoutRef" : "maven-2-default",
  "enableNuGetSupport" : false,
  "enableGemsSupport" : false,
  "enableNpmSupport" : false,
  "url" : "http://download.java.net/maven/1",
  "username" : "",
  "password" : "",
  "handleReleases" : true,
  "handleSnapshots" : true,
  "suppressPomConsistencyChecks" : true,
  "remoteRepoChecksumPolicyType" : "",
  "hardFail" : false,
  "offline" : false,
  "blackedOut" : false,
  "storeArtifactsLocally" : true,
  "socketTimeoutMillis" : 15000,
  "localAddress" : "",
  "retrievalCachePeriodSecs" : 43200,
  "assumedOfflinePeriodSecs" : 300,
  "missedRetrievalCachePeriodSecs" : 7200,
  "unusedArtifactsCleanupPeriodHours" : 0,
  "fetchJarsEagerly" : false,
  "fetchSourcesEagerly" : false,
  "shareConfiguration" : false,
  "synchronizeProperties" : false,
  "maxUniqueSnapshots" : 0,
  "propertySets" : [ "artifactory" ],
  "remoteRepoLayoutRef" : "maven-1-default",
  "archiveBrowsingEnabled" : false,
  "listRemoteFolderItems" : true,
  "rejectInvalidJars" : false,
  "p2Support" : false,
  "rclass" : "remote"
}

Error message:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "remoteRepoLayoutRef" (class org.jfrog.artifactory.client.model.impl.RemoteRepositoryImpl), not marked as ignorable (41 known properties: , "notes", "includesPattern", "rclass", "propertySets", "enableNpmSupport", "fetchSourcesEagerly", "unusedArtifactsCleanupEnabled", "localAddress", "suppressPomConsistencyChecks" [truncated]])
 at [Source: java.io.StringReader@428d5de1; line: 34, column: 28] (through reference chain: org.jfrog.artifactory.client.model.impl.RemoteRepositoryImpl["remoteRepoLayoutRef"])

Stack Trace:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79),
com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:579),
com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:672),
com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:906),
com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:328),
com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121),
com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2797),
com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1943),
com.fasterxml.jackson.databind.ObjectMapper$readValue$1.call(Unknown Source),org.jfrog.artifactory.client.impl.ArtifactoryImpl.parseText(ArtifactoryImpl.groovy:210),
sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source),
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43),
java.lang.reflect.Method.invoke(Method.java:483),
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:207),
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68),
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120),
org.jfrog.artifactory.client.impl.RepositoryHandleImpl.get(RepositoryHandleImpl.groovy:60)
...

Add delete method to java API

The REST API allows you to delete an item, but I couldn't find anything in the java API that does this. Could this be added? It looks a little ugly to mix REST API with java API. Thanks for your help with this.

Password Authentication

I am currently hardcoding a password in my test of the client and receiving the following message in the logs:

09:26:08.780 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 401 Artifactory configured to accept only encrypted passwords but received a clear text password.
09:26:08.780 [main] DEBUG org.apache.http.headers - << HTTP/1.1 401 Artifactory configured to accept only encrypted passwords but received a clear text password.
09:26:08.780 [main] DEBUG org.apache.http.headers - << Server: Artifactory/2.6.4

I noticed in the unit tests the code in ArtifactoryTestsBase simply reads from a properties file and instantiates the client with those values without any sort of encryption. I am just curious how I need to handle this.

Thanks.

Deb package appears to not honor modified files

Forgive me if this is not the proper place for this, but thought I should bring this up.

We currently run an artifactory service which upgraded from 5.3.2 to 5.4.0 (OSS). It appears that during that upgrade the /etc/opt/jfrog/artifactory/db.properties file was upgraded, or otherwise reverted to original installation state. We are unsure as to the exact specifics at this time, but nonetheless, we had to manually revert that file from a previous backup.

Can I just get verification that that should NOT have happened? Thanks!

Groovy dependency prevents adoption

The requirement for Groovy 2.0 is onerous on consumers, especially since it's not groovy-all. There are many cases where this conflicts with other versions of Groovy, e.g. trying to use this effectively in a Gradle plugin. For a library appended with "-java" it probably shouldn't require any Groovy at all, but that's another issue. But if you're going to use it, I'd recommend using the lowest possible version of groovy-all, e.g. 1.8.8.

Improve 40x error handler to give feedback in comment exception

Hi,

When you are using the client (here v2.3.2), some error could occurs, like permissions (bad login/password, user not authorized to write in repo/path, ...).

In this case, with this snippet:

File file = new File("target", "test.file");
FileUtils.write(file, "Hello world", Charset.defaultCharset());
Artifactory artifactory = ArtifactoryClient.create("http://artifactory.company.com", "foo", "bar");
artifactory.repository("any-repository").upload("subPathNoPermission/test.file", file).doUpload();
artifactory.close();

When the login/password is bad, the exception is:

org.apache.http.client.ClientProtocolException
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:886)
  [...]
	at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:75)
  [...]
	at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:74)
  [...]
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
	at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:53)
  [...]
Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity.
	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:663)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
	... 81 more

When the login has not permissions on repo/path:

groovyx.net.http.HttpResponseException: Forbidden
	at groovyx.net.http.RESTClient.defaultFailureHandler(RESTClient.java:263)
  [...]
	at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:53)
  [...]

A useful improvement could be to write the 40x error code & JSon message in the Java exception.

Possible, because on bad login/password, DEBUG shows (with Artifactory v4.13.0):

org.apache.http.wire -  << "{[\n]"
org.apache.http.wire -  << "  "errors" : [ {[\n]"
org.apache.http.wire -  << "    "status" : 401,[\n]"
org.apache.http.wire -  << "    "message" : "Bad credentials"[\n]"
org.apache.http.wire -  << "  } ][\n]"
org.apache.http.wire -  << "}"

For permissions:

org.apache.http.wire -  << "{[\n]"
org.apache.http.wire -  << "  "errors" : [ {[\n]"
org.apache.http.wire -  << "    "status" : 403,[\n]"
org.apache.http.wire -  << "    "message" : "User foo is not permitted to deploy or cache 'subPathNoPermission/test.file' into 'any-repository:subPathNoPermission/test.file'."[\n]"
org.apache.http.wire -  << "  } ][\n]"
org.apache.http.wire -  << "}"

What is the right way to download files without running out of memory?

We use artifactory java bindings from this project to download content from our artifactory. I am running into outofmemory when downloading a file with size 460MB. Below is the exception trace.

The code snippet that implements the download is below.


            try
            {
                if (null == fileHandle)
                    fileHandle = aRepo.download(remotePath);
                if (null == fileHandle)
                {
                    Logger.getGlobal().log(Level.SEVERE, "Unable to get download artifact handle for remote path: {0}", remotePath);
                    bResult = false;
                    continue;
                }                    
                
                InputStream in = fileHandle.doDownload();

                if (null == in)
                {
                    Logger.getGlobal().log(Level.SEVERE, "Unable to download remote file: {0}", remotePath);
                    bResult = false;
                }
                else
                {
                    File fileOut = new File(localPath);

                    if (null != fileOut.getParentFile())
                        fileOut.getParentFile().mkdirs();
                    fileOut.createNewFile();
                    OutputStream out = new FileOutputStream(fileOut);
                    IOUtils.copy(in, out);
                    IOUtils.closeQuietly(in);
                    IOUtils.closeQuietly(out);
                    bResult = true;
                    break;
                } 
            }
            catch (Throwable ex)
            {
                bResult = false;
                if (!propagateExceptionsUp)
                    Logger.getGlobal().log(Level.SEVERE, "Exception while downloading "+remotePath+", retrying...", ex);
                else
                    throw ex;                    
            }


++++Exception+++++++++++++

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3236)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
at org.codehaus.groovy.runtime.IOGroovyMethods.leftShift(IOGroovyMethods.java:219)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.leftShift(DefaultGroovyMethods.java:14058)
at groovyx.net.http.HTTPBuilder.defaultSuccessHandler(HTTPBuilder.java:620)
at groovyx.net.http.RESTClient.defaultSuccessHandler(RESTClient.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:952)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
at groovy.lang.Closure.call(Closure.java:423)
at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:503)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:222)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
at groovyx.net.http.RESTClient.get(RESTClient.java:119)
at groovyx.net.http.RESTClient$get.call(Unknown Source)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.getInputStream(ArtifactoryImpl.groovy:146)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.getInputStream(ArtifactoryImpl.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:187)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)

Expose repository size in RepositoryHandle

The Artifactory UI can expose the size of a repo by clicking on the "Count..." button. There is no documented API to access this value. Can it be exposed? Can it be added to api/src/main/java/org/artifactory/client/RepositoryHandle.java?

Uploading a file using a file or an inputstream doesn't seem to work.

    <dependency>
        <groupId>org.jfrog.artifactory.client</groupId>
        <artifactId>api</artifactId>
        <version>0.8</version>
        <type>jar</type>
    </dependency>

    <dependency>
        <groupId>org.jfrog.artifactory.client</groupId>
        <artifactId>services</artifactId>
        <version>0.8</version>
        <type>jar</type>
    </dependency>

package bugs;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import org.jfrog.artifactory.client.Artifactory;
import org.jfrog.artifactory.client.ArtifactoryClient;
import org.jfrog.artifactory.client.RepositoryHandle;
import org.jfrog.artifactory.client.UploadableArtifact;

public class TestUpload {
private static final Artifactory af = ArtifactoryClient.create(
"http://test.artifactory/artifactory/",
"areese",
"password");

private static final RepositoryHandle repository = af
        .repository("areese-ssh-proxy-test");

public static void main(String[] args) throws Exception {
    File file = new File(
            "src/main/yinst/package.txt");
    InputStream is = new FileInputStream(file);

    // UploadableArtifact uploadIs = repository
    // .upload("/com/yahoo/dps/sshd/0.0.1-SNAPSHOT/package.txt",
    // is);
    //uploadIs.doUpload();

    UploadableArtifact uploadFile = repository
            .upload("/com/yahoo/dps/sshd/0.0.1-SNAPSHOT/package.txt",
                    file);
    uploadFile.doUpload();
}

}

File Upload output:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/ch/qos/logback/logback-classic/1.0.9/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.ru
ntime.GStringImpl, java.util.LinkedHashMap, java.io.BufferedInputStream, java.util.LinkedHashMap, java.lang.Class, groovyx.net.http.ContentType, java.lang.Long) values: [/com/ya
hoo/dps/sshd/0.0.1-SNAPSHOT/package.txt, ...]
Possible solutions: wait(), any(), dump(), grep(), find()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
at groovy.lang.Closure.call(Closure.java:415)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(DefaultGroovyMethods.java:17421)
at org.codehaus.groovy.runtime.dgm$953.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:60)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:52)
at bugs.TestUpload.main(TestUpload.java:34)

InputStream upload output:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/ch/qos/logback/logback-classic/1.0.9/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/home/y/tmp/m2-repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.ru
ntime.GStringImpl, java.util.LinkedHashMap, java.io.FileInputStream, java.util.LinkedHashMap, java.lang.Class, groovyx.net.http.ContentType, java.lang.Integer) values: [/com/yah
oo/dps/sshd/0.0.1-SNAPSHOT/package.txt, ...]
Possible solutions: wait(), any(), dump(), grep(), find()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
at groovy.lang.Closure.call(Closure.java:415)
at groovy.lang.Closure.call(Closure.java:428)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.withStream(DefaultGroovyMethods.java:17421)
at org.codehaus.groovy.runtime.dgm$953.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:60)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:52)
at bugs.TestUpload.main(TestUpload.java:29)

Please add a method to RepositoryHandle to get information about an item that could be a folder or a file.

I want to get information about a path which might be a folder or a file.

However, org.jfrog.artifactory.client.RepositoryHandle only gives me a file() and folder() method.

I'd like to be able to get an Item back and have isFolder() return true if it's a folder on the server. Currently ifFolder seems to only check if it can be cast to Folder, and not if the actual object is a folder. So even if an Item were returned I wouldn't be able to use isFolder to determine if it's a folder because it's a cast check, and not a validation of the json, or a check on children.

It would also be really really nice, if I could access the children information from the item object after turning it into a folder without an extra rest call.

If I call repository.file("/foo/"), then I get an exception because it cannot parse the json because children was not recognized.

Exception in thread "main" com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "children" (class org.jfrog.artifactory.client.model.impl.FileImpl), not marked as ignor
able (16 known properties: , "modifiedBy", "size", "downloadUri", "path", "lastUpdated", "created", "remoteUrl", "uri", "folder", "mimeType", "checksums", "repo", "metadataUri", "lastModified", "origi
nalChecksums" [truncated]])
at [Source: java.io.StringReader@36475635; line: 1, column: 286](through reference chain: org.jfrog.artifactory.client.model.impl.FileImpl["children"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79)
at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:555)

If I call repository.file("/foo/file.txt"), then I get an exception because it cannot parse the json because downloadUri was not recognized.

Exception in thread "main" com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "downloadUri" (class org.jfrog.artifactory.client.model.impl.FolderImpl), not marked as
ignorable (11 known properties: , "modifiedBy", "path", "lastUpdated", "created", "uri", "folder", "repo", "metadataUri", "lastModified", "children", "createdBy"])
at [Source: java.io.StringReader@12328f00; line: 1, column: 307](through reference chain: org.jfrog.artifactory.client.model.impl.FolderImpl["downloadUri"])

Sample code is here:

    Artifactory af = ArtifactoryClient.create(
            "http://artifactory/artifactory/",
            "areese",
            "password");

    RepositoryHandle repository = af.repository("repo");

    ItemHandle file = repository
            .file("dumpingground/saxon/saxon/9.1.0.8/saxon-9.1.0.8.jar");
    System.err.println(file.info().getClass());

    ItemHandle dir = repository.file("dumpingground/saxon/saxon/9.1.0.8/");
    System.err.println(dir.info());

Add api/search/latestVersion

Artifactory api has 'api/search/latestVersion' but the sreach client miss this.

could you add this to the client?

thanks

Feature request: support for GAVC search/Artifact Version search

I'm working on a tool that will be periodically searching Artifactory for new versions of specific group/artifact coordinates. Based on my perusal of the Artifactory REST API docs, it looks like either of these search types may be good enough for my use case, however neither appears to currently be supported by the Java client library.

http://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-GAVCSearch
http://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ArtifactVersionSearch

In a perfect world, I'd like for the search endpoints to also support filtering by create date. I suppose I'll handle that client-side for now.

SNI Problems with version 1.2.2

Dear developers,

I would really like to use your software here, but it is prone to SNI (https://de.wikipedia.org/wiki/Server_Name_Indication) problems as it seems in the following stack trace. Most probably the reasons is that the groovy stuff is using an outdated
HTTP Client library. Could you try to update that apache library?

The setup is the following:

Take an reverse proxy like apache or nginx. But two different virtual hosts on the same
ip-adress, port number. Use HTTPS to access them. A wildcard certificate could work,
but out of reasons we can't use them.

Best regards,
Dieter

    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:172)
    at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:61)
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:140)
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:114)
    at org.apache.http.conn.ssl.SSLSocketFactory.verifyHostname(SSLSocketFactory.java:569)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:544)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:409)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:220)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:434)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:383)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.restWrapped(ArtifactoryImpl.groovy:233)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$restWrapped(ArtifactoryImpl.groovy)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$restWrapped$0.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.rest(ArtifactoryImpl.groovy:204)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$rest(ArtifactoryImpl.groovy)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$rest.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.put(ArtifactoryImpl.groovy:171)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:187)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:66)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:439)
    at org.codehaus.groovy.runtime.IOGroovyMethods.withStream(IOGroovyMethods.java:1186)
    at org.codehaus.groovy.runtime.dgm$731.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:65)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent$0.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:58)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:53

Getting child nodes by using repo path

Hey baruch, I need a small info. If I have a repo path, can you please tell me how do we get children of that respective repo path, I can see we get from Folder interface. If I have an Artifactory instance how do I get a Folder instance with the help of Artifactory instance and a repopath, please help I am stuck in the middle.

Use Artifactory API Key to login with artifactory.client

If it's possible to log in with the Artifactory API key I could bypass the corporate LDAP. The LDAP can be a slowing factor and I read that the API key bypasses the problem.

When setting up the connection with Artifactory you can give X-JFrog-Art-Api: <YOUR_API_KEY> as header.
the solution could look like:

//new part
if (apiKey) {
client.headers.'X-JFrog-Art-Api'= apiKey
}
//This is already there ->
if (username && password) {
            client.auth.basic username, password
            client.headers.Authorization = "Basic ${"$username:$password".toString().bytes.encodeBase64()}"
        }

Odd Ivy XML file caused exception

I had a few ivy.xml files in a repo I was scanning and these files were looked at as I was looking for directories / folders. For these files, isFolder was broken and returned true. I was doing the .info() method to get at the number of children (looking for a zero to tell me not to recurse into it), but got an exception below. Very odd.

My work around was to not upload those odd files and delete all the existing ones (manually as my automation couldn't scan them) and everything else worked fine.

14:38:34.019 [main] WARN groovyx.net.http.RESTClient - Error parsing 'application/vnd.org.jfrog.artifactory.storage.FileInfo+json' response com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "downloadUri" (class org.jfrog.artifactory.client.model.impl.FolderImpl), not marked as ignorable (11 known properties: , "modifiedBy", "path", "lastUpdated", "created", "uri", "folder", "repo", "metadataUri", "lastModified", "children", "createdBy"])
at [Source: org.apache.http.conn.EofSensorInputStream@4a4c1677; line: 1, column: 272](through reference chain: org.jfrog.artifactory.client.model.impl.FolderImpl["downloadUri"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79)[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:568)
[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:650) ~[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:830) ~[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:310) ~[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112) ~[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2577) ~[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1856) ~[jackson-databind-2.0.4.jar:na]
at com.fasterxml.jackson.databind.ObjectMapper$readValue$0.call(Unknown Source) ~[na:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$_rest_closure1.doCall(ArtifactoryImpl.groovy:139) ~[artifactory-java-client-services-0.13.jar:na]
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.Closure.call(Closure.java:423) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.Closure.call(Closure.java:439) [groovy-2.3.2.jar:2.3.2]
at groovyx.net.http.HTTPBuilder.parseResponse(HTTPBuilder.java:551) [http-builder-0.7.jar:na]
at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:480) ~[http-builder-0.7.jar:na]
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1070) [httpclient-4.2.1.jar:4.2.1]
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1044) [httpclient-4.2.1.jar:4.2.1]
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:506) [http-builder-0.7.jar:na]
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:425) [http-builder-0.7.jar:na]
at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:374) [http-builder-0.7.jar:na]
at groovyx.net.http.HTTPBuilder$request.call(Unknown Source) [http-builder-0.7.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.restWrapped(ArtifactoryImpl.groovy:170) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$restWrapped(ArtifactoryImpl.groovy) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$restWrapped$1.callCurrent(Unknown Source) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.rest(ArtifactoryImpl.groovy:143) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.rest(ArtifactoryImpl.groovy) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$rest(ArtifactoryImpl.groovy) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$rest$0.callCurrent(Unknown Source) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.groovy:99) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$get.callCurrent(Unknown Source) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.groovy:95) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.groovy) [artifactory-java-client-services-0.13.jar:na]
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:187) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) [groovy-2.3.2.jar:2.3.2]
at org.jfrog.artifactory.client.impl.ItemHandleImpl.info(ItemHandleImpl.groovy:34) [artifactory-java-client-services-0.13.jar:na]
at org.jfrog.artifactory.client.ItemHandle$info$0.call(Unknown Source) [artifactory-java-client-api-0.13.jar:na]
at ArtifactoryProcess.processArtifactsRecursive(ArtifactoryProcess.groovy:281) [ArtifactoryProcess.groovy:na]
at ArtifactoryProcess.this$2$processArtifactsRecursive(ArtifactoryProcess.groovy) [ArtifactoryProcess.groovy:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess$_processArtifactsRecursive_closure4.doCall(ArtifactoryProcess.groovy:301) [ArtifactoryProcess.groovy:na]
at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.Closure.call(Closure.java:423) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.Closure.call(Closure.java:439) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1373) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1366) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess.processArtifactsRecursive(ArtifactoryProcess.groovy:285) [ArtifactoryProcess.groovy:na]
at ArtifactoryProcess.this$2$processArtifactsRecursive(ArtifactoryProcess.groovy) [ArtifactoryProcess.groovy:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess$_processArtifactsRecursive_closure4.doCall(ArtifactoryProcess.groovy:301) [ArtifactoryProcess.groovy:na]
at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.Closure.call(Closure.java:423) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.Closure.call(Closure.java:439) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1373) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1366) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.dgm$149.invoke(Unknown Source) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess.processArtifactsRecursive(ArtifactoryProcess.groovy:285) [ArtifactoryProcess.groovy:na]
at ArtifactoryProcess.this$2$processArtifactsRecursive(ArtifactoryProcess.groovy) [ArtifactoryProcess.groovy:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess$_doMain_closure2.doCall(ArtifactoryProcess.groovy:206) [ArtifactoryProcess.groovy:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess.withClient(ArtifactoryProcess.groovy:459) [ArtifactoryProcess.groovy:na]
at ArtifactoryProcess.this$2$withClient(ArtifactoryProcess.groovy) [ArtifactoryProcess.groovy:na]
at ArtifactoryProcess$this$2$withClient$0.callCurrent(Unknown Source) [ArtifactoryProcess.groovy:na]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess.doMain(ArtifactoryProcess.groovy:203) [ArtifactoryProcess.groovy:na]
at ArtifactoryProcess$doMain.call(Unknown Source) [ArtifactoryProcess.groovy:na]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) [groovy-2.3.2.jar:2.3.2]
at ArtifactoryProcess.main(ArtifactoryProcess.groovy:137) [ArtifactoryProcess.groovy:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1318) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:875) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:265) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.GroovyShell.run(GroovyShell.java:502) [groovy-2.3.2.jar:2.3.2]
at groovy.lang.GroovyShell.run(GroovyShell.java:491) [groovy-2.3.2.jar:2.3.2]
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:650) [groovy-2.3.2.jar:2.3.2]
at groovy.ui.GroovyMain.run(GroovyMain.java:381) [groovy-2.3.2.jar:2.3.2]
at groovy.ui.GroovyMain.process(GroovyMain.java:367) [groovy-2.3.2.jar:2.3.2]
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:126) [groovy-2.3.2.jar:2.3.2]
at groovy.ui.GroovyMain.main(GroovyMain.java:106) [groovy-2.3.2.jar:2.3.2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_51]
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106) [groovy-2.3.2.jar:2.3.2]
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128) [groovy-2.3.2.jar:2.3.2]
Caught: groovyx.net.http.ResponseParseException: OK
groovyx.net.http.ResponseParseException: OK
at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:486)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1070)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1044)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:506)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:425)
at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:374)
at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.restWrapped(ArtifactoryImpl.groovy:170)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$restWrapped(ArtifactoryImpl.groovy)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$restWrapped$1.callCurrent(Unknown Source)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.rest(ArtifactoryImpl.groovy:143)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.rest(ArtifactoryImpl.groovy)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$rest(ArtifactoryImpl.groovy)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$rest$0.callCurrent(Unknown Source)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.groovy:99)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$get.callCurrent(Unknown Source)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.groovy:95)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl.get(ArtifactoryImpl.groovy)
at org.jfrog.artifactory.client.impl.ItemHandleImpl.info(ItemHandleImpl.groovy:34)
at org.jfrog.artifactory.client.ItemHandle$info$0.call(Unknown Source)
at ArtifactoryProcess.processArtifactsRecursive(ArtifactoryProcess.groovy:281)
at ArtifactoryProcess.this$2$processArtifactsRecursive(ArtifactoryProcess.groovy)
at ArtifactoryProcess$_processArtifactsRecursive_closure4.doCall(ArtifactoryProcess.groovy:301)
at ArtifactoryProcess.processArtifactsRecursive(ArtifactoryProcess.groovy:285)
at ArtifactoryProcess.this$2$processArtifactsRecursive(ArtifactoryProcess.groovy)
at ArtifactoryProcess$_processArtifactsRecursive_closure4.doCall(ArtifactoryProcess.groovy:301)
at ArtifactoryProcess.processArtifactsRecursive(ArtifactoryProcess.groovy:285)
at ArtifactoryProcess.this$2$processArtifactsRecursive(ArtifactoryProcess.groovy)
at ArtifactoryProcess$_doMain_closure2.doCall(ArtifactoryProcess.groovy:206)
at ArtifactoryProcess.withClient(ArtifactoryProcess.groovy:459)
at ArtifactoryProcess.this$2$withClient(ArtifactoryProcess.groovy)
at ArtifactoryProcess$this$2$withClient$0.callCurrent(Unknown Source)
at ArtifactoryProcess.doMain(ArtifactoryProcess.groovy:203)
at ArtifactoryProcess$doMain.call(Unknown Source)
at ArtifactoryProcess.main(ArtifactoryProcess.groovy:137)
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "downloadUri" (class org.jfrog.artifactory.client.model.impl.FolderImpl), not marked as ignorable (11 known properties: , "modifiedBy", "path","lastUpdated", "created", "uri", "folder", "repo", "metadataUri", "lastModified", "children", "createdBy"])
at [Source: org.apache.http.conn.EofSensorInputStream@4a4c1677; line: 1, column: 272](through reference chain: org.jfrog.artifactory.client.model.impl.FolderImpl["downloadUri"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:79)
at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:568)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:650)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:830)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:310)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:112)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2577)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1856)
at com.fasterxml.jackson.databind.ObjectMapper$readValue$0.call(Unknown Source)
at org.jfrog.artifactory.client.impl.ArtifactoryImpl$_rest_closure1.doCall(ArtifactoryImpl.groovy:139)
at groovyx.net.http.HTTPBuilder.parseResponse(HTTPBuilder.java:551)
at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:480)
... 34 more

How to run the tests?

Hello, we have done some additions to this library and would like to give back the contributions. The thing is that we weren't able to run the test suite for the artifactory-client module.

We managed to pass the tests for the ning-client using a docker artifactory, but we didn't have the same luck with the artifactory-client-api tests.

I made a gist with the log: https://gist.github.com/amanya/f6bbc0c5b6c9a4c8970d

I was wondering if do you have some guidelines on how to run the testsuite.

Thanks!

There is no "principals" for the permission target builder

While i try to create new permission target i have no way to add user and group with permissions, cause it use the item permission and it's doesn't match the json file.
json file:
{

  • "name": "populateCaches",
  • "includesPattern": "**" (default),
  • "excludesPattern": "" (default),
  • "repositories": ["local-rep1", "local-rep2", "remote-rep1", "virtual-rep2"],
  • "principals": {
    "users" : {
    "bob": ["r","w","m"],
    "alice" : ["d","w","n", "r"]
    },
    "groups" : {
    "dev-leads" : ["m","r","n"],
    "readers" : ["r"]
    }
    }
    }

what we get:
{
"name": "test1",
"includesPattern": "**" ,
"excludesPattern": "" ,
"repositories": ["new-local"],
"itemPermissions": {
"users" : {
"test1": ["r","w","m"],
"test2" : ["d","w","n", "r"],
"test3" : ["r"]
},
"groups" : {
"deployers" : ["m","r","n"],
"users" : ["r"]
}
}
}

on ArtifactoryClient.create exception thrown

I'm getting the following error when I try to instantiate the Artifactory client.

This seems similar to Issues #22 and #15

ArtifactoryClient artifactory = ArtifactoryClient.create(resolverServerUrl, resolverUsername, resolverPassword);

groovy.lang.MissingMethodException: No signature of method: com.fasterxml.jackson.databind.ObjectMapper.addMixIn() is applicable for argument types: (java.lang.Class, java.lang.Class) values: [interface org.jfrog.artifactory.client.model.Repository, ...] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55) at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at org.jfrog.artifactory.client.impl.ArtifactoryImpl.<init>(ArtifactoryImpl.groovy:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194) at org.jfrog.artifactory.client.ArtifactoryClient.create(ArtifactoryClient.groovy:87) at org.jfrog.artifactory.client.ArtifactoryClient.create(ArtifactoryClient.groovy) at com.jenkins.plugins.servicenow.artifactory.ArtifactoryService.<init>(ArtifactoryService.java:36) at com.ge.integration.jenkins.notification.Phase.initialize(Phase.java:152) at com.ge.integration.jenkins.notification.Phase.perform(Phase.java:210) at com.ge.integration.jenkins.notification.Phase.handle(Phase.java:114) at com.ge.integration.jenkins.notification.JobListener.onFinalized(JobListener.java:52) at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:230) at hudson.model.Run.onEndBuilding(Run.java:1890) at hudson.model.Run.execute(Run.java:1809) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381)

Error when deploying artifact with services-0.8-all

Hey Baruch,

I am using services-0.8-all.jar for trying to deploy artifact on artifactory and I wrote this code to make it works.

Artifactory artifactory = org.jfrog.artifactory.client.ArtifactoryClient.create("http://myip:8080/artifactory", username, password);

java.io.File file = new File("path/to/my/local/jar");

RepositoryHandle repoHandle = artifactory.repository(repoWhereToUpload);

UploadableArtifact uploadable = repoHandle.upload("path/to/remote/jar/to/create",file);

uploadable.doUpload();

When I execute the preceding code I've got this message :

Exception in thread "main" groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, java.util.LinkedHashMap, java.io.BufferedInputStream, java.util.LinkedHashMap, java.lang.Class, groovyx.net.http.ContentType, java.lang.Long) values: [/jk_p/02.12.00/jk_p-02.12.00.jar, ...]
Possible solutions: wait(), any(), dump(), find(), grep()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
at groovy.lang.Closure.call(Closure.java:411)
at groovy.lang.Closure.call(Closure.java:427)
at org.codehaus.groovy.runtime.IOGroovyMethods.withStream(IOGroovyMethods.java:1160)
at org.codehaus.groovy.runtime.dgm$709.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:60)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:52)
at fr.cnamts.repo.rest.Main.testArtifactory(Main.java:270)
at fr.cnamts.repo.rest.Main.main(Main.java:160)

Have you got any idea where it could be from ?

Thanks

I am running with :
->eclipse galileo
->Windows 7
-> jdk 1.7.0_13

Race condition with RPM metadata

When trying to push an rpm package using the java artifactory client, and adding 'X-uploaded-by=username', some of the RPMs are missing it, and it just contains RPM metadata properties.
This appears to be sort of a race condition when updating the rpm properties, it might remove existing properties.

Verified by Baruch. Related ticket: https://jfrog.freshdesk.com/helpdesk/tickets/32612

How to disable the org.apache.http.wire DEBUG log

I used the file upload function, but there is many http debug log. I start the upload by a separate process(Main program runs, when needed, it will start upload small program), so I can't added the -Dxxx=yyyy to the java starting arguments. Any help is appreciated. Thank you!

16:02:09.497 [main] DEBUG org.apache.http.wire - >> "Accept: application/json, application/javascript, text/javascript[\r][\n]"
16:02:09.497 [main] DEBUG org.apache.http.wire - >> "Authorization: Basic YWRtaW46cGFzc3dvcmQ=[\r][\n]"
16:02:09.497 [main] DEBUG org.apache.http.wire - >> "User-Agent: Artifactory-Client/1.0[\r][\n]"
16:02:09.497 [main] DEBUG org.apache.http.wire - >> "Content-Length: 4646[\r][\n]"
16:02:09.497 [main] DEBUG org.apache.http.wire - >> "Content-Type: application/octet-stream[\r][\n]"
16:02:09.497 [main] DEBUG org.apache.http.wire - >> "Host: 127.0.0.1:8081[\r][\n]"
16:02:09.497 [main] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"

Parallel upload doesn't seem to work

Hi,

I am trying to upload files in multi-threaded way (using ForkJoin Framework). It doesnt seem to work.

In my code, every individual thread creates its own client(for upload) with Artifactory org.jfrog.artifactory.client.ArtifactoryClient.create(String url, String username, String password)

I could not find the documentation but it looks like the ArtifactoryClientis singleton and the stub(httpclient?) returned by above method would be one and shared between multiple threads calling the .create() method. Single upload works fine, but multi-threaded upload fails with below error

org.apache.http.client.ClientProtocolException
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:886)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:220)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:164)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:434)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:383)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.restWrapped(ArtifactoryImpl.groovy:230)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$restWrapped(ArtifactoryImpl.groovy)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$restWrapped$0.callCurrent(Unknown Source)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.rest(ArtifactoryImpl.groovy:204)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.this$2$rest(ArtifactoryImpl.groovy)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl$this$2$rest.callCurrent(Unknown Source)
    at org.jfrog.artifactory.client.impl.ArtifactoryImpl.put(ArtifactoryImpl.groovy:171)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:187)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$_uploadContent_closure1.doCall(UploadableArtifactImpl.groovy:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:439)
    at org.codehaus.groovy.runtime.IOGroovyMethods.withStream(IOGroovyMethods.java:1186)
    at org.codehaus.groovy.runtime.dgm$731.invoke(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:248)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:74)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent$0.callCurrent(Unknown Source)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.uploadContent(UploadableArtifactImpl.groovy:67)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.this$3$uploadContent(UploadableArtifactImpl.groovy)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl$this$3$uploadContent.callCurrent(Unknown Source)
    at org.jfrog.artifactory.client.impl.UploadableArtifactImpl.doUpload(UploadableArtifactImpl.groovy:53)
    at com.bhuvnesh.ice.repository.impl.RepositoryAccessImpl.addOrReplace(RepositoryAccessImpl.java:66)
    at com.bhuvnesh.ice.repository.impl.SerialUpload.compute(SerialUpload.java:40)
    at com.bhuvnesh.ice.repository.impl.SerialUpload.upload(SerialUpload.java:61)
    at com.bhuvnesh.ice.repository.impl.TestRecursiveRepositoryAccessImpl.serialUpload(TestRecursiveRepositoryAccessImpl.java:69)
    at com.bhuvnesh.ice.repository.impl.TestRecursiveRepositoryAccessImpl.testUploadDownloadRemoveSuiteSerial(TestRecursiveRepositoryAccessImpl.java:91)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:254)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:193)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity.  The cause lists the reason the original request failed.
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:659)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
    ... 77 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:181)
    at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115)
    at org.apache.http.entity.InputStreamEntity.writeTo(InputStreamEntity.java:146)
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:112)
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:117)
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:265)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:203)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:685)
    ... 79 more


Tech stack used: Spring for bean initialization and Java ForkJoinFramework for multi-threading

Adding getters to the repository builder classes

I'm currently using the different repository builder classes (RepositoryBuilder, VirtualRepositoryBuilder, LocalRepositoryBuilder, etc) to implement some automation in Artifactory.

The automation consists in implementing some generic rules (Example: "All remote repos should be online") which operate on the AF repositories. When a violation to the rule is detected, the rule automatically reconfigures the repository to fix the issue (thanks to the builder class) and commits the change to AF. Rules are meant to be very simple and we want to apply lots of different rules to configure the AF server.

However, I have identified that the lack of getters on the different repository builder classes makes it difficult to implement those rules. Because the builder class doesn't allow me to read the configuration currently stored in the builder instance, it's not possible for me to apply incremental changes to the configuration of a repository.

I hope the following pseudo-code will shed some light.

// Retrieve the rules to apply to the virtual repos
def rules = getVirtualRepositoryRules() as List<VirtualRepositoryRule>

// Loop over all the virtual repos in AF
virtualRepos.each { repository ->
  // Backup the repository configuration to detect changes (not detailed)

  // Create a builder class to allow rules to reconfigure the repository (if necessary)
  VirtualRepositoryBuilder builder = artifactory.repositories().builders()
    .builderFrom(repository)
    .repositorySettings(repository.repositorySettings)
    .xraySettings(repository.xraySettings)

  // Apply all the rules to the current virtual repository
  rules.each { rule ->
    rule.apply(repository, builder)
  }

  // Build the updated configuration
  def updatedConfiguration = configuration.build()

  // Compare the initial and update configurations (not detailed)
  def changeDetected = ...

  if (changeDetected) {
    // Submit the changes to AF
    artifactory.repositories().update(updatedConfiguration)
  }
}

In the scenario above, the same builder object is passed to different rule objects and "accumulates" the changes applied by the different rules (the first rule can apply some changes, the second rule can apply other changes, etc).

This approach cannot work because the repository builder classes only offer setter methods. The lack of getter methods makes it impossible for the second rule to see the changes introduced by the first rule (they're not yet applied to the server).

I hope this makes sense.

For instance, the change would consist in adding the following getters to the class VirtualRepositoryBuilderImpl.

Collection<String> getRepositories() {
    this.repositories
}

boolean isArtifactoryRequestsCanRetrieveRemoteArtifacts() {
    this.artifactoryRequestsCanRetrieveRemoteArtifacts
}

String getDefaultDeploymentRepo() {
    this.defaultDeploymentRepo
}

I'm willing to contribute a PR if you think this request makes sense.

NoClassDefFoundError on ArtifactoryClient

I'm not a Java developer so sorry if this is a stupid question.

Folder layout:

artifactory-client-java-example/
    artifactory-java-client-api-1.0.0.jar
    artifactory-java-client-ning-services-1.0.0.jar
    artifactory-java-client-services-1.0.0.jar
    Example.java

Example.java:

import org.jfrog.artifactory.client.Artifactory;
import org.jfrog.artifactory.client.ArtifactoryClient;

public class Example {
    public static void main(String[] args) {
        Artifactory af = ArtifactoryClient.create("https://my_url/artifactory", "admin", "admin");
    }
}

Error:

$ javac -classpath "./*" Example.java
$ java Example
Exception in thread "main" java.lang.NoClassDefFoundError: org/jfrog/artifactory/client/ArtifactoryClient
    at Example.main(Example.java:6)
Caused by: java.lang.ClassNotFoundException: org.jfrog.artifactory.client.ArtifactoryClient
[...]

What am I doing wrong? Is there an example somewhere of how to use this package? Thanks!

Building 2.3.4 is throwing exceptions

I am trying to build artifactory client release 2.3.4 on my win10 system. When I issued "gradlew tasks" like below, I am getting ton of errors.
Is there a help file on how to build?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
\artifactory_2.3.4>gradlew -Dhttp.proxyHost=proxy -Dhttps.proxyHost=proxy -Dhttp.proxyPort=80 -Dhttps.proxyPort=80 tasks
Creating $fileName
[buildinfo] Not using buildInfo properties file for this build.
:tasks


All tasks runnable from root project

:tasks FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':tasks'.

Could not resolve all dependencies for configuration ':artifactory-java-client-ning-services:runtimeCopy'.
Could not resolve com.ning:async-http-client:1.8.7.
Required by:
org.jfrog.artifactory.client:artifactory-java-client-ning-services:2.3.4
> Could not resolve com.ning:async-http-client:1.8.7.
> Could not get resource 'https://oss.jfrog.org/libs-release/com/ning/async-http-client/1.8.7/async-http-client-1.8.7.pom'.
> Could not GET 'https://oss.jfrog.org/libs-release/com/ning/async-http-client/1.8.7/async-http-client-1.8.7.pom'. Received status code 407 from server: authenticationrequired
> Could not resolve com.ning:async-http-client:1.8.7.

Possible Setup Problem

Running jdk1.7.0_25, I get the following exception when I call Artifactory.repository(repoName).upload(path, file). Any help is appreciated. Thanks.

09:35:45.287 [main] DEBUG groovyx.net.http.RESTClient - Parsed data to instance of: class java.util.HashMap

groovy.lang.MissingMethodException: No signature of method: org.jfrog.artifactory.client.impl.ArtifactoryImpl.put() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, java.util.LinkedHashMap, java.io.BufferedInputStream, java.util.LinkedHashMap, java.lang.Class, groovyx.net.http.ContentType, java.lang.Long) values: [/ext-release-local/activation/activation/1.0.2, ...]
Possible solutions: wait(), dump(), any(), find(), grep()
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)

PrincipalsBuilder how to use ?

Hi,

I'm trying to use PrincipalsBuilder to add a Principals in the PermissionTargetBuilder but I'm a little lost as the the PrincipalsBuilderImpl constructor is private. Could you provide a complete example on how to create a new permissionTarget or how to use the PrincipalsBuilderImpl ?

Thank you in advance

Client won't upload files bigger than 2g

The client would silently fail to upload files bigger than 2g. The upload will allegedly finish successfully, however, the connection will be closed prematurely (for an unclear reason - ruling out any OOM issues) but only 2g will be streamed.

Full support of external group

Hi,

When you have linked Artifactory to an LDAP and you want inject some groups with API (before inject some permission, for preload all security stuff before user login), you can't.

Mainly because you can't fill realmAttributes (and realm)

A workaround is to extend GroupImpl and add this management in it ... but it would be simpler if this parameters could be used in GroupBuilder.

artifactory.security().createOrUpdateGroup(myGroupRealmImpl);

Best regards

Client does not send Accept: */* default header

This problem has been traced back to this library, while trying to connect to an Artifactory installation from the Jenkins-Artifactory plugin to retrieve repository information.

That operation generated a request to Artifactory with no Accept header defined, which caused the Apache proxy server in front of Artifactory to return a 403. Accept headers are optional, but most of the http client libraries and http client tools by default add "Accept: / to the request to prevent the request being rejected from servers with tight security configuration (especially Apache servers with mod_security installed).

The Artifactory client plugin seems not to add any other header except for the authorisation token, thus creating the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.