Bug 965591

Summary: [JBT]Fails to import jbossews apps to the workspace with error "couldn't import maven project null " shown caused by the imported name "jbossews-example"
Product: OpenShift Online Reporter: joycezhang <jinzhang>
Component: ContainersAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: adietish, dmcphers, xtian
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-11 04:07:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
couldn't import maven project error none

Description joycezhang 2013-05-21 11:50:48 UTC
Description of problem:
If trying to create jbossews-1.0/2.0 apps and import to workspace, it would be failed if there was a jbossews app imported to the workspace already. Please refer to following error:
org.jboss.tools.openshift.express.internal.ui.ImportFailedException: Could not import project null. One of the possible reasons is that theres already a project in your workspace that matches the openshift application/maven name of the OpenShift application. Please rename your workspace project in that case and start over again.

Version-Release number of selected component (if applicable):
INT(devenv_3250)
JBDS 6.0 GA with JBoss OpenShift Tools	2.4.0.Final-v20121205-2147-B97	

How reproducible:
always

Steps to Reproduce:
1.Launch JBDS and create a new jbossews-1.0/jbossews-2.0 (cartridge/type) app on OpenShift
2.Create another jbossews-1.0/jbossews-2.0 app


Actual results:
It would be failed as it imported as "jbossews-example" in the workspace instead of app name.

Expected results:
It should be successful.

Additional info:
For jbossas app, it can be created successfully always as it imported with the appname which is identical.

Comment 1 joycezhang 2013-05-21 11:56:26 UTC
Created attachment 751077 [details]
couldn't import maven project error

Comment 2 Xiaoli Tian 2013-05-21 14:33:16 UTC
Copied one comment from https://issues.jboss.org/browse/JBIDE-14546:

If you create a jbossas-7 application you get a project with an artifactId (in the pom.xml) which matches the OpenShift application name:
Create a jbossas-7 application called as76 and get:
<groupId>as76</groupId>
<artifactId>as76</artifactId>

If you create a jbossews-2.0 application you get a constant artifactId that does NOT match the OpenShift application name:

Create a jbossews-2.0 application called ews123123 and get:
<groupId>com.openshift.example.jbossews</groupId>
<artifactId>jbossews-example</artifactId>
Thus a user wont be able to create and import 2 different jbossews applications.

Comment 3 Andre Dietisheim 2013-05-28 17:40:21 UTC
It looks like as if this was fixed. I cannot reproduce it any more when creating jbossews-1 and jbossews-2 applications. In both cases the artifact id in the maven pom is not constant any more, it's set to match the application name.

Comment 4 joycezhang 2013-05-29 03:02:16 UTC
This bug is not fixed on INT(devenv_3281), the artifiactID is still "jbossews-example" as below

# cat pom.xml 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.openshift.example.jbossews</groupId>
	<artifactId>jbossews-example</artifactId>
	<packaging>war</packaging>
	<version>1.0</version>
	<name>jbossews-example</name>
	<repositories>
		<repository>
			<id>eap</id>
			<url>http://maven.repository.redhat.com/techpreview/all</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

Comment 5 Dan McPherson 2013-05-29 03:49:47 UTC
https://github.com/openshift/origin-server/pull/2669

Comment 7 joycezhang 2013-05-29 10:58:04 UTC
Verified this bug on devenv_3283, the artifiactID is changed as app name for jbossews-1.0/2.0 app as below:

# cat pom.xml 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>ews2</groupId>
	<artifactId>ews2</artifactId>
	<packaging>war</packaging>
	<version>1.0</version>
	<name>ews2</name>
	<repositories>
		<repository>
			<id>eap</id>
			<url>http://maven.repository.redhat.com/techpreview/all</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>