Description of problem: Not able create new project containing spaces in 'name' via REST API. It results in an invalid artifactID being generated in the pom.xml file. ~~~~~ ERROR [org.kie.workbench.common.services.backend.builder.BuildServiceImpl] (http-localhost.localdomain/127.0.0.1:8080-3) org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs: [ERROR] 'artifactId' with value 'My New Project' does not match a valid id pattern. @ line 6, column 15 : java.lang.RuntimeException: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs: [ERROR] 'artifactId' with value 'My New Project' does not match a valid id pattern. @ line 6, column ~~~~~ Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Start BPMS 6.1 server instance. 2. Use following command to create new project: curl -i -X POST -H "Content-Type:application/json" http://admin:admin12#@localhost:8080/business-central/rest/repositories/repository1/projects/ --data '{"name":"My New Project","description":"My description of the project.","groupId":"org.jboss.test","version":"1.0.0"}' Actual results: project created with invalid artifactId. Expected results: Project should be created with valid artifactId. Additional info:
No spaces in the project id (which is the artifactId of the artifact) is an (apache) maven constraint, as shown in the stack trace above. As far as I can tell, there is no good solution to this problem. Abhijit, because of this, I'd like to close this. Would that be okay? Is there another solution you have in mind?
Created attachment 1052980 [details] Sourcefile
Created attachment 1052981 [details] TestPatch
Attached patch files are not tested by Red Hat QA team.Its not supported ,recommended to use in production environment, it can be used in development environment.
Abhijit, what happens in this situation: 1. Client creates project with name "MyProjName". 2. Client creates project with name "My Proj Name" What do you think should happen in this case?
Marco, 1. Client creates project with name "MyProjName". Project created successfully with "Project Name" `MyProjName` and artifactId is set to "MyProjName". 2. Client creates project with name "My Proj Name" Project created successfully with "Project Name"--> `My Proj Name` and artifactId is set to "MyProjName" As per my understanding its correct behaviour. Please share thoughts on this.
Abhijit, The behavior you describe above is not technically possible: artifactIds must be unique. In step 2, an error would be thrown because the "MyProjName" project already exists. The UI has different behavior than what you describe above. In the UI, the following happens: 1. Client creates project with name "MyProjName". -> Project created successfully. 2. Client creates project with name "My Proj Name" -> Project name is corrected to "MyProjName" and shown to the user. -> If the user then proceeds, an error is thrown that the project already exists. Unfortunately, the REST API is not interactive in the same way that the UI is. I'm not sure what a better behavior for the REST API would be for this. What do you think? Do you have any ideas for what the REST API should do in this case?
Marco Rietveld <marco.rietveld> updated the status of jira JBPM-4703 to Resolved
Rejecting this issue (see my comment 9 above). If there is a solution that fixes the problem outlined in comment 9, please reopen the issue.