Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1088211

Summary: Business Central deploys projects to repositories defined in settings.xml
Product: [Retired] JBoss BRMS Platform 6 Reporter: Jiri Locker <jlocker>
Component: Business CentralAssignee: manstis
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Locker <jlocker>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.0.2CC: etirelli, rrajasek
Target Milestone: ER2   
Target Release: 6.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:53:57 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
server.log with exception stack trace none

Description Jiri Locker 2014-04-16 09:04:23 UTC
Created attachment 886806 [details]
server.log with exception stack trace

Description of problem:
With 6.0.2.ER1 my attempts to build&deploy any project fail with the following error in Problems panel:

org.sonatype.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact mortgages:mortgages:jar:0.0.1 from/to jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/): Failed to transfer file: https://repository.jboss.org/nexus/content/groups/public-jboss/mortgages/mortgages/0.0.1/mortgages-0.0.1.jar. Return code is: 401, ReasonPhrase:Unauthorized.

This is because I have https://repository.jboss.org/nexus/content/groups/public-jboss/ repository enabled in my ~/.m2/settings.xml.

This change in behaviour is apparently result of https://issues.jboss.org/browse/GUVNOR-2088. However AFAIU the repositories declaration is merely intended as a read-only source of dependencies. Repositories for artifact deployment need to be declared inside pom.xml/project/distributionManagement.

Version-Release number of selected component (if applicable):
6.0.2.ER1

How reproducible:
Needs to have a repository enabled in ~/.m2/settings.xml:

  <profiles>
    <profile>
      <id>jboss-public-repository</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>jboss-public-repository-group</id>
          <name>JBoss Public Maven Repository Group</name>
          <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

Steps to Reproduce:
1. Log into Business Central, go to Project Authoring
2. Choose any project, open Project Editor
3. Click Build&Deploy

Actual results:
Build fails

Expected results:
Business Central should not attempt to deploy projects into repositories that are not part of distributionManagement in POM of that project. If this is, on the other hand, intended or necessary then:
a) there should be a WARNING about this default behaviour in Admin Guide
b) it should be possible to point Business Central to certain settings.xml, overriding the global ~/.m2/settings.xml. And this needs to be documented too.

Additional info:

Comment 3 manstis 2014-04-16 10:17:19 UTC
You are correct Jiri,

Upon review repositories defined in settings.xml should be considered as "read only" as they should only be used during compilation to resolve dependencies. I have therefore removed the code that deployed to such repositories. 

See https://maven.apache.org/settings.html#Repositories

"Repositories are remote collections of projects from which Maven uses to populate the local repository of the build system. It is from this local repository that Maven calls it plugins and dependencies. Different remote repositories may contain different projects, and under the active profile they may be searched for a matching release or snapshot artifact."