Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 3.6.0
-
Fix Version/s: None
-
Component/s: Content Selectors, Security
-
Labels:
Description
Our help text in the UI content selectors states:
Select all "maven2" content with a groupId that starts with "org.sonatype.nexus"
format == "maven2" and coordinate.groupId =~ "^org.sonatype.nexus."
However, if I create a content selector based on this it does not work:
format == "maven2" and coordinate.groupId =~ "^com.example."
Preview results does not return anything that has a group ID that starts with "com.example.".
This makes sense, since "=~" implies a regular expression is needed. If I change to this:
format == "maven2" and coordinate.groupId =~ "^com\.example\..*"
Then preview results does work. So it seems the help text is wrong.
A user assigned a privilege based on the working content selector above cannot deploy into a the repository:
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ project --- Downloading from foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/0.9.0-SNAPSHOT/maven-metadata.xml Downloaded from foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/0.9.0-SNAPSHOT/maven-metadata.xml (986 B at 16 kB/s) Uploading to foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/0.9.0-SNAPSHOT/project-0.9.0-20171115.152352-5.jar Uploaded to foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/0.9.0-SNAPSHOT/project-0.9.0-20171115.152352-5.jar (2.3 kB at 29 kB/s) Uploading to foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/0.9.0-SNAPSHOT/project-0.9.0-20171115.152352-5.pom Uploaded to foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/0.9.0-SNAPSHOT/project-0.9.0-20171115.152352-5.pom (2.1 kB at 65 kB/s) Downloading from foo: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/maven-metadata.xml [WARNING] Could not transfer metadata com.example.bar:project/maven-metadata.xml from/to foo (http://localhost:8081/repository/maven-snapshots): Access denied to: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/maven-metadata.xml , ReasonPhrase:Forbidden. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.425 s [INFO] Finished at: 2017-11-15T09:23:52-06:00 [INFO] Final Memory: 24M/306M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project project: Failed to retrieve remote metadata com.example.bar:project/maven-metadata.xml: Could not transfer metadata com.example.bar:project/maven-metadata.xml from/to foo (http://localhost:8081/repository/maven-snapshots): Access denied to: http://localhost:8081/repository/maven-snapshots/com/example/bar/project/maven-metadata.xml , ReasonPhrase:Forbidden. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
If I remove the "coordinate.groupId" from the content selector above then the deploy succeeds.
Either our help text is wrong, coordinate.groupId selectors are broken, or both.
Attachments
Issue Links
- is related to
-
NEXUS-12238 Partial coordinates for maven metadata
-
- Done
-