Giter Site home page Giter Site logo

thiagofigueiro / nexus3-cli Goto Github PK

View Code? Open in Web Editor NEW
24.0 4.0 19.0 491 KB

Python CLI and bindings for Sonatype's Nexus OSS 3

Home Page: https://nexus3-cli.readthedocs.io/en/latest/

nexus-repository-manager nexus3 python-library python-script

nexus3-cli's Introduction

nexus3-cli's People

Contributors

amritanshu-pandey avatar bt-thiago avatar cyrilleverrier avatar dependabot-preview[bot] avatar dependabot-support avatar manics avatar nikolaev14 avatar russoz avatar slackwar avatar thiagofigueiro avatar verhyppo 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

Watchers

 avatar  avatar  avatar  avatar

nexus3-cli's Issues

Repository management broken in Nexus 3.21.1

Error: b'{\n  "name" : "nexus3-cli-repository-create",\n  "result" : "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:\\nScript9.groovy: 43: You cannot create an instance from the abstract interface \'org.sonatype.nexus.repository.config.Configuration\'.\\n @ line 43, column 26.\\n       Configuration conf = new Configuration(\\n                            ^\\n\\n1 error\\n"\n}'

repository.collection.get_by_name missing yum repo attributes

The Yum repository class has the default depth to 1.

When get_by_name creates the local object instance, the json response it uses doesn't have all attributes and the Yum class will use its default of 1, regardless of the actual depth set:

There's already a FIXME with a suggested refactor that would fix this issue.

https://github.com/thiagofigueiro/nexus3-cli/blob/master/src/nexuscli/api/repository/collection.py#L89-L93

pytest tests/cli/test_subcommand_repository.py::test_create_hosted_yum[ALLOW-0--None]

>       assert nexus_client.repositories.get_by_name(repo_name).depth == depth
E       assert 1 == 0
E         -1
E         +0

image

Support for docker repositories

I was wondering why Docker isn't a supported format, I tried to add it and it seemed to work just fine. Can someone enlighten me?

Replace docopt with Click or argparse

This project has outgrown docopt. It doesn't support sub-commands natively and it's all become a bit hacky.

In fact, I believe the CLI is currently broken in the master branch, preventing new releases.

Some issues running integration tests with pytest

Hi,
I'm not an expert of pytest and I'm trying to run integration tests.
I'm running them on Ubuntu 18.04. Since nexus3-cli is using Python3 and the distro defaults to Python2 I did the following

$ virtualenv -p /usr/bin/python3 py3env
$ source py3env/bin/activate


$ pip --version  # I have pip 19.3.1 from /home/francesco/work/nexus3-cli/py3env/lib/python3.6/site-packages/pip (python 3.6)

$ pip install  -e .
$ pip install pytest faker

$ docker run -d --rm -p 127.0.0.1:8081:8081 --name nexus sonatype/nexus3
$ ./tests/wait-for-nexus.sh  # the Nexus instance takes a while to be ready
$ ./tests/nexus-login $(docker exec nexus cat /nexus-data/admin.password)

$ pytest -m integration

stty: 'standard input': Inappropriate ioctl for device
ImportError while loading conftest '/home/francesco/work/nexus3-cli/tests/conftest.py'.
tests/conftest.py:60: in <module>
    @pytest.helpers.register
E   AttributeError: module 'pytest' has no attribute 'helpers'

what am I missing?
I have pytest == 5.3.2 and Faker==3.0.0...

thanks

1.0.2 SyntaxError with Python 2.7

Looks to be caused by: a43e018#diff-67d9082bd31cecf1378914edfd204ad3

$ nexus3 repo list
Traceback (most recent call last):
  File "/usr/local/bin/nexus3", line 7, in <module>
    from nexuscli.cli import main
  File "/usr/local/lib/python2.7/site-packages/nexuscli/__init__.py", line 2, in <module>
    from . import cli, exception, nexus_client
  File "/usr/local/lib/python2.7/site-packages/nexuscli/cli.py", line 70, in <module>
    from .nexus_client import NexusClient
  File "/usr/local/lib/python2.7/site-packages/nexuscli/nexus_client.py", line 292
    query['keyword'] = f'"{path_filter}"'  # hacky as fuck :(
                                        ^
SyntaxError: invalid syntax
$ python --version
Python 2.7.14
$

support for APT repositories

It would be nice to have integration with all kind of repositories in order to facilitate the integration with nexus, removing unuseful scripts to setup and delete repositories.

Here the issue for APT support.

Remove use of groovy scripts where possible

From Nexus 3.21.2, scripting is disabled by default. When nexus3-cli was first created, the REST API didn't have much to offer so a lot of the functionality depends on groovy scripts.

The REST API has been continuously improved and, these days, it might be possible to achieve most of what we need using it.

This issue is to discover which features can be done using the REST API and write some issues to replace the groovy script with an API implementation. This should be done for versions that support the required API calls - we might choose to keep the groovy scripts around for older versions, at least in the short-medium term.

See: https://support.sonatype.com/hc/en-us/articles/360045220393-Scripting-Nexus-Repository-Manager-3

Circular dependency on CLI

Version 2.2.0 may error out with:

[root@131d9af6b2b9 nexus3-cli]# python -c 'from nexuscli.nexus_client import NexusClient'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/.pyenv/versions/3.6.7/lib/python3.6/site-packages/nexuscli/nexus_client.py", line 12, in <module>
    from nexuscli import exception, nexus_util
  File "/root/.pyenv/versions/3.6.7/lib/python3.6/site-packages/nexuscli/exception.py", line 1, in <module>
    from nexuscli.cli.errors import CliReturnCode
  File "/root/.pyenv/versions/3.6.7/lib/python3.6/site-packages/nexuscli/cli/__init__.py", line 41, in <module>
    from nexuscli.cli import errors, util
  File "/root/.pyenv/versions/3.6.7/lib/python3.6/site-packages/nexuscli/cli/util.py", line 5, in <module>
    from nexuscli.nexus_client import NexusClient
ImportError: cannot import name 'NexusClient'

delete command not working as expected

Hi,
I tried using "nexus3 delete" CLI command against a YUM repository in my Nexus3 but it is not actually deleting the stuff I think it should delete.

The folder structure of the YUM repo is the following:

    myrepo
      +-- repo-rhel
             +-- x86_64
             |     +-- myrpm1.rpm
             |     +-- myrpm2.rpm
             +-- repodata

and I tried issuing the command

nexus3 delete myrepo/repo-rhel/x86_64/
Deleting[################################] 12/12 - 00:00:00
Deleted 12 files

So apparently something was deleted but then I go to the Nexus3 web interface and I still the folder containing lots of RPMs... so I wonder:

  1. what was deleted? What are those 12 deleted files? Is it possible to add a --verbose option to actually see what is being deleted?
  2. why didn't nexus3-cli erased all the contents of that "myrepo/repo-rhel/x86_64/" folder?

I can actually contribute some patch if needed...

thanks

Cleanup policy management broken for Nexus >= 3.20.x

Tested nexus3-cli 3.0.0 with Nexus 3.20.1:

11:27 $ nexus3 cleanup-policy list
Error: b'{\n  "name" : "nexus3-cli-cleanup-policy",\n  "result" : "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:\\nScript3.groovy: 58: You cannot create an instance from the abstract interface \'org.sonatype.nexus.cleanup.storage.CleanupPolicy\'.\\n @ line 58, column 17.\\n   cleanupPolicy = new CleanupPolicy(\\n                   ^\\n\\n1 error\\n"\n}'

I suppose there's another breaking change in the Nexus Groovy API. ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

i get nexuscli.exception.NexusClientAPIError: <exception str() failed> trying to list the repositories

for some reason i cannot connect to the client

nexus_config = nexuscli.nexus_config.NexusConfig(username=NEXUS_USER,
                                                 password=NEXUS_PASSWORD,
                                                 url=NEXUS_URL,
                                                 x509_verify=False)
nexus_client = nexuscli.nexus_client.NexusClient(config=nexus_config)
print(nexus_client.repositories.list)

i get:
nexuscli.exception.NexusClientAPIError: <exception str() failed>

but if i do a manual call to api using the request library like uploading a file such:

import requests
files = {
    'raw.directory': (None, 'testing/testing2'),
    'raw.asset1': ('temp_sftp_files/testing.zip;application/x-zip-compressed', open('temp_sftp_files/testing.zip', 'rb')),
    'raw.asset1.filename': (None, 'testing3.zip'),
}
response = requests.post('https://my_site.net/service/rest/v1/components?repository=my_repo', files=files, auth=(NEXUS_USER, NEXUS_PASSWORD), verify=False)
print(response)
print(response.text)

so i know that i have the right user and password, i am missing something?
super thanks =)

Remove logging.basicConfig call from root package __init__

logging.basicConfig is called in the main package __init__.py. This means that it is called even when just importing the API. This should only be called in end user code, ie. scripts that behave as command-line interfaces, therefore, perhaps a more appropriate place for this would be in cli.__init__.py if that is what is defining the CLI.

nexus3 login Unicode issue on python 2

nexus3 login
Nexus OSS URL (http://localhost:8081):https://example.com
Nexus admin username (admin):x
Nexus admin password (admin123):
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:857: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)
Traceback (most recent call last):
  File "/usr/bin/nexus3", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/nexuscli/cli.py", line 294, in main
    do_login()
  File "/usr/lib/python2.7/site-packages/nexuscli/cli.py", line 102, in do_login
    client.write_config()
  File "/usr/lib/python2.7/site-packages/nexuscli/nexus_client.py", line 107, in write_config
    }, ensure_ascii=False)
TypeError: must be unicode, not str

Upload file to root of raw repo fails

test-raw-repo is a new empty raw repository in Nexus3

virtualenv --python=python3 env_nexus3cli
source env_nexus3cli/bin/activate

(env_nexus3cli) โžœ pip install nexus3-cli
Successfully installed nexus3-cli-2.0.0

(env_nexus3cli) โžœ touch test.txt

(env_nexus3cli) โžœ  ~ nexus3 upload test.txt test-raw-repo
Uploading test.txt to test-raw-repo
Traceback (most recent call last):
  File "/home/cyrille/env_nexus3cli/bin/nexus3", line 10, in <module>
    sys.exit(main())
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/cli/__init__.py", line 98, in main
    return _run_root_commands(arguments)
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/cli/__init__.py", line 68, in _run_root_commands
    return command_method(client, arguments)
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/cli/root_commands.py", line 100, in cmd_upload
    recurse=(not args.get('--norecurse')))
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/nexus_client.py", line 418, in upload
    recurse=recurse, flatten=flatten)
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/nexus_client.py", line 390, in _upload_dir_or_file
    repository.upload_file(src_dir, dst_dir, dst_file)
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/api/repository/model.py", line 291, in upload_file
    upload_method(self, src_file, dst_dir, dst_file)
  File "/home/cyrille/env_nexus3cli/lib/python3.7/site-packages/nexuscli/api/repository/upload.py", line 21, in upload_file_raw
    'Destination path does not contain a directory, which is '
nexuscli.exception.NexusClientInvalidRepositoryPath: Destination path does not contain a directory, which is required by raw repositories

I have tried the following variants:

  • nexus3 upload test.txt test-raw-repo
  • nexus3 upload test.txt test-raw-repo/
  • nexus3 upload ./test.txt test-raw-repo
  • nexus3 upload ./test.txt test-raw-repo/
  • nexus3 upload test.txt test-raw-repo/test.txt
  • nexus3 upload ./test.txt test-raw-repo/test.txt
  • nexus3 upload /home/cyrille/test.txt test-raw-repo/test.txt

With a folder in the destination path:

(env_nexus3cli) โžœ  ~ nexus3 upload /home/cyrille/test.txt test-raw-repo/test/
Uploading /home/cyrille/test.txt to test-raw-repo/test/
Uploaded 1 file to test-raw-repo/test/

Add support for Docker image

Thinking off the top of my head:

  1. On first run, do something like docker run --rm -it -v $(pwd):/root nexus3-cli login
  2. Change the login command to write two files:
    1. The usual ~/.nexus3-cli
    2. An additional ~/.nexus3-cli.env
  3. On subsequent uses, use something like docker run --rm -it --env-file ~/.nexus3-cli.env CMD ...
  4. Suggest an alias to be added to the user's profile like alias nexus3='docker run ...' (i.e. the usage above)

In addition to the above, add integration tests for the docker image and publish it to docker hub (using latest for master and also the tag name for version`

Docker image

This is more of an info. Feel free to either include Dockerfile here, ignore and close the issue, or link to the docker repository.

I've created an image for this module and published it at docker hub. This prevents me from installing tons of packages on a server where they shouldn't be needed, so I can automate deployment of nexus3.

FROM python:3-alpine

USER root

RUN apk add --no-cache --update --virtual .build-deps build-base libffi-dev openssl-dev && \
    pip install nexus3-cli && \
    apk del .build-deps && \
    rm -rf ~/.cache/pip

https://hub.docker.com/r/krezovic/nexus3-cli

Silence InsecureRequestWarning

When the user has chosen to not verify the x509 certificate with "nexus_verify": false, we should silence the warning below.

AttributeError: 'module' object has no attribute 'X509_up_ref'
/home/611036184/.local/lib/python2.7/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecureRequestWarning)

Issue with Upload path

This line is preventing files from being uploaded to the proper nexus path when running in windows environment: api/repository/upload.py
22 dst_dir = os.path.normpath(dst_dir or REMOTE_PATH_SEPARATOR)

Removing this line yields expected results, but recognize this line was introduced with b2f1321

To re-create this issue:

import os
from pathlib import PurePosixPath

from nexuscli import nexus_config, nexus_client
from nexuscli.api import repository
from nexuscli.api.repository import upload
...

def ul_nexus_asset(env_dtl, component, file_name):
    client = instantiate_nexus_client()
    repo = client.repositories.get_by_name("my-nexus-repo")
    dst = str(PurePosixPath("my_root/{}/{}".format(env_dtl, component)))

    files_uploaded = repository.upload.upload_file_raw(repo, str(file_name), dst, file_name.name)

def instantiate_nexus_client():
    config = nexus_config.NexusConfig(url=NEXUS_URL,
                                      username='someuser',
                                      password='z@nyPa$sword')
    client = nexus_client.NexusClient(config=config)
    client.repositories.refresh()
    return client

uploaded file will get uploaded but does not upload to a directory:
In nexus the component group is created as
/my_root \ environ \ component
instead of
/my_root / environ / component (which is what get's created when you upload a component directly in nexus)

CLI options not working in version 2.1.0

Tried the following:

pip3 install --upgrade nexus3-cli
nexus3 upload foo bar --norecurse

and I noticed that also this case does not work: I get the docopt help printed instead of the upload command output.
If I remove the --norecurse option from the invocation it works!

Allow full downloads on large repos

Thx for writing this.. has eased a lot of stuff with repo transfers between instances.

Added this around line 176 of nexus_client.py

try:
     content = response.json()
   except json.decoder.JSONDecodeError:
     raise exception.NexusClientAPIError(response.content)

and got the following:

nexuscli.exception.NexusClientAPIError: b'ERROR: (ID 40b7714e-41ac-416a-8cbc-7fe8b7a0b639) 
Failed to execute phase [query], all shards failed;
shardFailures {[pUq2BG92Raedvpiju7ztMg][215bfafbc6963d8c9f7ec9a57f88c6223b00dfa6][0]:
RemoteTransportException[[8A042D9D-8A28015E-AF29C30B-EC2AE858-7B66110B][local[1]][indices:data/read/search[phase/query]]]; nested: 
QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [10050]. 
See the scroll api for a more efficient way to request large data sets.
This limit can be set by changing the [index.max_result_window]
index level parameter.]; }

I think this is an elastic search issue with nexus etc and I doubt they will fix it anytime soon.

Wrote a quick wrapper to use the cli to download every sub directory. Would be cool if you could implement a way to do this within the cli.

e.g. grab the directory structure and download each sub directory 1 by 1.

nexus3 repository create --cleanup policy fails: java.lang.String cannot be cast to java.util.Set

Connecting to Docker sonatype/nexus3:3.19.1

$ nexus3 --version
2.1.0

$ nexus3 cleanup_policy list
Name          Format        lastDownloaded   lastBlobUpdated
test          ALL_FORMATS   null             1209600

$ nexus3 repository create hosted maven maven-internal --cleanup=test
Traceback (most recent call last):
  File "/venv/bin/nexus3", line 11, in <module>
    sys.exit(main())
  File "/venv/lib64/python3.6/site-packages/nexuscli/cli/__init__.py", line 108, in main
    return _run_subcommand(arguments, maybe_subcommand)
  File "/venv/lib64/python3.6/site-packages/nexuscli/cli/__init__.py", line 90, in _run_subcommand
    return subcommand_method(argv)
  File "/venv/lib64/python3.6/site-packages/nexuscli/cli/subcommand_repository.py", line 154, in main
    return command_method(util.get_client(), arguments)
  File "/venv/lib64/python3.6/site-packages/nexuscli/cli/subcommand_repository.py", line 117, in cmd_create
    nexus_client.repositories.create(r)
  File "/venv/lib64/python3.6/site-packages/nexuscli/api/repository/collection.py", line 248, in create
    raise exception.NexusClientCreateRepositoryError(resp)
nexuscli.exception.NexusClientCreateRepositoryError: {'name': 'nexus3-cli-repository-create', 'result': 'java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Set'}

Cannot get API example working

I cannot get the api example working, I don't know if this is related with 2.x upgrade but I'm using 1.0.2version.

import nexuscli
nexus_config = nexuscli.nexus_config.NexusConfig(
        url=os.getenv('NEXUS_URL'),
        user=os.getenv('NEXUS_USER'),
        password=os.getenv('NEXUS_PWD'))

gets

Module 'nexuscli' has no 'nexus_config' member

Getting an error uploading

I tried out the nexus3-cli and I get the following error upoloading, why is that ?

[root@alt-dts-g-sonar02] ~/testdir/spoe/SPOE/0.8 $ nexus3 download snapshots/test/test/1.4-SNAPSHOT/ test/
Downloading snapshots/test/test/1.4-SNAPSHOT/ to test/
Downloading[################################] 12/12 - 00:00:00
Downloaded 12 files to test/
[root@alt-dts-g-sonar02] ~/testdir/spoe/SPOE/0.8 $ nexus3 up test/ snapshots/test/
Uploading test/ to snapshots/test/
Error: b'[ {\n "name" : "dockerCleanup",\n "content" : "import org.sonatype.nexus.repository.storage.Asset;import org.sonatype.nexus.repository.storage.Query;import org.sonatype.nexus.repository.storage.StorageFacet;import groovy.json.JsonOutput;import groovy.json.JsonSlurper;def request = new JsonSlurper().parseText(args);println(request);assert request.repoName: 'repoName parameter is required';assert request.startDate: 'startDate parameter is required, format: yyyy-mm-dd';assert request.url: 'Assest url is required, format: %/cache/%';assert request.timeFilter instanceof String;def tq = request.timeFilter.toString() + ' < ';def repo = repository.repositoryManager.get(request.repoName);StorageFacet storageFacet = repo.facet(StorageFacet);def tx = storageFacet.txSupplier().get();def urls = [];try { tx.begin(); Iterable assets = tx. findAssets(Query.builder().where(tq.toString()).param(request.startDate).and('name MATCHES').param(request.url).build(), [repo]); urls = assets.collect {'/repository/'+ repo.name + '/' + it.name()}; assets.each { asset -> log.info('Deleting asset ' + asset.name()); tx.deleteAsset(asset); if (asset.componentId() != null) { log.info('Deleting component for asset ' + asset.name()); def component = tx.findComponent(asset.componentId()); tx.deleteComponent(component); } }; tx.commit(); def result = JsonOutput.toJson([ assets : urls, query : tq.toString(), query_term : request.url, before : request.startDate, repoName: request.repoName ]); log.info(JsonOutput.prettyPrint(result)); return result;} catch (Exception e) { log.warn('Error occurs while deleting snapshot images from docker repository: {}', e.toString()); tx.rollback();} finally { tx.close();}",\n "type" : "groovy"\n}, {\n "name" : "version",\n "content" : " import org.sonatype.nexus.repository.storage.Query; import org.sonatype.nexus.repository.storage.StorageFacet; import groovy.json.JsonOutput; def groupId = args.split(',')[0]; def repositoryId = args.split(',')[1]; def repo = repository.repositoryManager.get(repositoryId); StorageFacet storageFacet = repo.facet(StorageFacet); def tx = storageFacet.txSupplier().get(); try{ tx.begin(); def components = tx.findComponents(Query.builder().where('group = ').param(groupId).build(), [repo]); def found = components.collect { def baseVersion = it.attributes().child('maven2').get('baseVersion'); \"${baseVersion}\" }; found = found.unique(); tx.commit(); def result = JsonOutput.toJson(found); tx.close(); return result;}catch (Exception e){ tx.rollback()}finally{ tx.close()}",\n "type" : "groovy"\n} ]'

Nexus repository create error

While I'm trying to create a repository using nexus3-cli, I'm getting the below error

[root@nexuscloud ~]# nexus3 repository create proxy yum --strict-content --health-check mysql-chris-test http://mysql-chris-test.com
/usr/local/lib/python3.9/site-packages/nexuscli/nexus_http.py:109: UserWarning: Nexus server version cannot be parsed: nginx
  warnings.warn(f'Nexus server version cannot be parsed: {server}')
Traceback (most recent call last):
  File "/usr/local/bin/nexus3", line 8, in <module>
    sys.exit(nexus_cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  [Previous line repeated 1 more time]
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/cli/util.py", line 39, in command
    return click_command(ctx, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/cli/__init__.py", line 345, in repository_create_proxy_yum
    _create_repository(ctx, 'proxy', **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/cli/__init__.py", line 160, in _create_repository
    subcommand_repository.cmd_create(ctx, repo_type=repo_type, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/cli/subcommand_repository.py", line 29, in cmd_create
    nexus_client.repositories.create(r)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/api/repository/collection.py", line 275, in create
    resp = self.run_script(self._script_create, data=script_args)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/api/base_collection.py", line 51, in run_script
    raise exception.NexusClientAPIError(resp.content)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/exception.py", line 90, in __init__
    _raise_if_error_is_mapped(message_bytes)
  File "/usr/local/lib/python3.9/site-packages/nexuscli/exception.py", line 75, in _raise_if_error_is_mapped
    raise TypeError(f'Unrecognised Nexus error response: {nexus_response}') from None
TypeError: Unrecognised Nexus error response: {'name': 'nexus3-cli-repository-create', 'result': "org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:\nScript16.groovy: 4: unable to resolve class org.sonatype.nexus.repository.storage.WritePolicy\n @ line 4, column 1.\n   import org.sonatype.nexus.repository.storage.WritePolicy\n   ^\n\nScript16.groovy: 43: You cannot create an instance from the abstract interface 'org.sonatype.nexus.repository.config.Configuration'.\n @ line 43, column 26.\n       Configuration conf = new Configuration(\n                            ^\n\n2 errors\n"}

My details of the server as follow

NAME="Rocky Linux"
VERSION="8.8 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.8 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.8"

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.