[forge-issues] [JBoss JIRA] (FORGE-1164) Cannot remove managed dependency
Vineet Reynolds (JIRA)
jira-events at lists.jboss.org
Thu Sep 5 06:46:03 EDT 2013
[ https://issues.jboss.org/browse/FORGE-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801839#comment-12801839 ]
Vineet Reynolds commented on FORGE-1164:
----------------------------------------
This command probably needs to clarify what a "managed dependency" is. The {{project remove-managed-dependency}} command works in removing dependencies managed in another Maven project/artifact (i.e. dependencies listed in the {{dependencies}} section of the current project POM but managed by a different project declared in the {{dependencyManagement}} section). The command does not work in removing the project declared in the {{dependencyManagement}} section:
{noformat}
[no project] vineet $ cd tmp/demo/
[demo] demo $ project list-
list-plugin-repositories list-facets list-repositories list-properties list-dependencies
list-managed-dependencies
[demo] demo $ project list-managed-dependencies
org.jboss.spec : jboss-javaee-6.0 : 3.0.2.Final : pom : import
[demo] demo $ project remove-
remove-plugin-repository remove-dependency remove-repository remove-facet remove-managed-dependency
remove-property
[demo] demo $ project remove-managed-dependency
[[ groupId :artifactId {:version :scope :packaging} ] (of type org.jboss.forge.project.dependencies.Dependency)]
[demo] demo $ project remove-managed-dependency org.jboss.spec:jboss-javaee-6.0:3.0.2.Final
Managed dependency [org.jboss.spec:jboss-javaee-6.0:::3.0.2.Final] not found in project...
[demo] demo $ project list-dependencies
org.hibernate.javax.persistence : hibernate-jpa-2.0-api : : jar : provided
[demo] demo $ project remove-managed-dependency org.hibernate.javax.persistence:hibernate-jpa-2.0-api
Removed managed dependency [org.hibernate.javax.persistence:hibernate-jpa-2.0-api:::]
Wrote /home/vineet/tmp/demo/pom.xml
[demo] demo $ project remove-dependency org.jboss.spec:jboss-javaee-6.0:3.0.2.Final:import:pom
Dependency [org.jboss.spec:jboss-javaee-6.0:pom::3.0.2.Final] not found in project...
{noformat}
So, this command removes an effectively managed dependency, but not the project that manages it, and nor is there any command to remove the managing project.
I'll let [~gastaldi] and [~lincolnthree] chime in with their opinions on what needs fixing here. This certainly looked confusing to me.
> Cannot remove managed dependency
> --------------------------------
>
> Key: FORGE-1164
> URL: https://issues.jboss.org/browse/FORGE-1164
> Project: Forge
> Issue Type: Bug
> Affects Versions: 1.4.0.Final
> Reporter: Antonio Goncalves
>
> I want to turn a Forge project from being Java EE 6 to Java EE 7 centric. One of these tasks is to change the dependencies in the {{pom.xml}}. So I add the {{javax:javaee-api:7.0}} to the pom and list the managed dependencies :
> {code}
> $ project list-managed-dependencies
> org.jboss.spec : jboss-javaee-6.0 : 3.0.2.Final : pom : import
> org.hibernate : hibernate-validator : 5.1.0.Alpha1 : jar : provided
> javax : javaee-api : 7.0 : jar : provided
> {code}
> If I remove the added {{javax:javaee-api:7.0}}, it works. But if I want to remove the {{org.jboss.spec:jboss-javaee-6.0}}, the console says it doesn't exist :
> {code}
> $ project remove-managed-dependency org.jboss.spec:jboss-javaee-6.0
> Managed dependency [org.jboss.spec:jboss-javaee-6.0:::] not found in project...
> {code}
> I even tried adding version, scope and so on, but it doesn't work :
> {code}
> $ project remove-managed-dependency
> ? [[ groupId :artifactId {:version :scope :packaging} ] (of type org.jboss.forge.project.dependencies.Dependency)]: org.jboss.spec:jboss-javaee-6.0:3.0.2.Final:pom:import
> Managed dependency [org.jboss.spec:jboss-javaee-6.0:import::3.0.2.Final] not found in project...
> {code}
> PS : same occur in Forge 1.3.3-Final
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the forge-issues
mailing list