[JBoss JIRA] (FORGE-2273) MavenFacet - Write properties sorted A..Z
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2273?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-2273.
----------------------------------
Fix Version/s: 2.15.2.Final
Resolution: Done
> MavenFacet - Write properties sorted A..Z
> -----------------------------------------
>
> Key: FORGE-2273
> URL: https://issues.jboss.org/browse/FORGE-2273
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven
> Affects Versions: 2.15.0.Final
> Reporter: Claus Ibsen
> Assignee: George Gastaldi
> Priority: Minor
> Labels: Starter
> Fix For: 2.15.2.Final
>
>
> We have a custom addon that adds various commands.
> We have a docket setup command that enables docker to a maven project. And for that we set some values in the <properties> section of the maven pom.xml.
> To update and set those, we use the following code:
> {code}
> // update properties section in pom.xml
> MavenFacet maven = project.getFacet(MavenFacet.class);
> Model pom = maven.getModel();
> Properties properties = pom.getProperties();
> properties.put("docker.registryPrefix", "${env.DOCKER_REGISTRY}/");
> properties.put("docker.from", fromImage);
> properties.put("docker.image", "${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}");
> properties.put("docker.assemblyDescriptorRef", descriptorRef);
> properties.put("docker.port.container.jolokia", "8778");
> if (war) {
> properties.put("docker.port.container.http", "8080");
> }
> // to save then set the model
> maven.setModel(pom);
> {code}
> Which then generates the following in the pom.xml
> {code}
> <properties>
> <docker.port.container.http>8080</docker.port.container.http>
> <docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
> <docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}</docker.image>
> <maven.compiler.target>1.7</maven.compiler.target>
> <docker.port.container.jolokia>8778</docker.port.container.jolokia>
> <docker.from>fabric8/tomcat-8.0</docker.from>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <docker.assemblyDescriptorRef>rootWar</docker.assemblyDescriptorRef>
> <maven.compiler.source>1.7</maven.compiler.source>
> </properties>
> {code}
> Notice the order of the properties is "random". It would be great if forge would sort the properties A..Z so they are more human readable.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-2273) MavenFacet - Write properties sorted A..Z
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2273?page=com.atlassian.jira.plugin... ]
George Gastaldi reopened FORGE-2273:
------------------------------------
Assignee: George Gastaldi
On a second thought, not having this fixed could be frustrating as the properties key-set order is random.
Having an absolute ordering shows to be a good solution
> MavenFacet - Write properties sorted A..Z
> -----------------------------------------
>
> Key: FORGE-2273
> URL: https://issues.jboss.org/browse/FORGE-2273
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven
> Affects Versions: 2.15.0.Final
> Reporter: Claus Ibsen
> Assignee: George Gastaldi
> Priority: Minor
> Labels: Starter
>
> We have a custom addon that adds various commands.
> We have a docket setup command that enables docker to a maven project. And for that we set some values in the <properties> section of the maven pom.xml.
> To update and set those, we use the following code:
> {code}
> // update properties section in pom.xml
> MavenFacet maven = project.getFacet(MavenFacet.class);
> Model pom = maven.getModel();
> Properties properties = pom.getProperties();
> properties.put("docker.registryPrefix", "${env.DOCKER_REGISTRY}/");
> properties.put("docker.from", fromImage);
> properties.put("docker.image", "${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}");
> properties.put("docker.assemblyDescriptorRef", descriptorRef);
> properties.put("docker.port.container.jolokia", "8778");
> if (war) {
> properties.put("docker.port.container.http", "8080");
> }
> // to save then set the model
> maven.setModel(pom);
> {code}
> Which then generates the following in the pom.xml
> {code}
> <properties>
> <docker.port.container.http>8080</docker.port.container.http>
> <docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
> <docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}</docker.image>
> <maven.compiler.target>1.7</maven.compiler.target>
> <docker.port.container.jolokia>8778</docker.port.container.jolokia>
> <docker.from>fabric8/tomcat-8.0</docker.from>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <docker.assemblyDescriptorRef>rootWar</docker.assemblyDescriptorRef>
> <maven.compiler.source>1.7</maven.compiler.source>
> </properties>
> {code}
> Notice the order of the properties is "random". It would be great if forge would sort the properties A..Z so they are more human readable.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-2273) MavenFacet - Write properties sorted A..Z
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2273?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-2273.
----------------------------------
Fix Version/s: (was: 2.x Future)
Resolution: Won't Fix
Marking as "Won't Fix", since it's possible to override the {{Properties}} object using the proposed solution
> MavenFacet - Write properties sorted A..Z
> -----------------------------------------
>
> Key: FORGE-2273
> URL: https://issues.jboss.org/browse/FORGE-2273
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven
> Affects Versions: 2.15.0.Final
> Reporter: Claus Ibsen
> Priority: Minor
> Labels: Starter
>
> We have a custom addon that adds various commands.
> We have a docket setup command that enables docker to a maven project. And for that we set some values in the <properties> section of the maven pom.xml.
> To update and set those, we use the following code:
> {code}
> // update properties section in pom.xml
> MavenFacet maven = project.getFacet(MavenFacet.class);
> Model pom = maven.getModel();
> Properties properties = pom.getProperties();
> properties.put("docker.registryPrefix", "${env.DOCKER_REGISTRY}/");
> properties.put("docker.from", fromImage);
> properties.put("docker.image", "${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}");
> properties.put("docker.assemblyDescriptorRef", descriptorRef);
> properties.put("docker.port.container.jolokia", "8778");
> if (war) {
> properties.put("docker.port.container.http", "8080");
> }
> // to save then set the model
> maven.setModel(pom);
> {code}
> Which then generates the following in the pom.xml
> {code}
> <properties>
> <docker.port.container.http>8080</docker.port.container.http>
> <docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
> <docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}</docker.image>
> <maven.compiler.target>1.7</maven.compiler.target>
> <docker.port.container.jolokia>8778</docker.port.container.jolokia>
> <docker.from>fabric8/tomcat-8.0</docker.from>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <docker.assemblyDescriptorRef>rootWar</docker.assemblyDescriptorRef>
> <maven.compiler.source>1.7</maven.compiler.source>
> </properties>
> {code}
> Notice the order of the properties is "random". It would be great if forge would sort the properties A..Z so they are more human readable.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-2273) MavenFacet - Write properties sorted A..Z
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2273?page=com.atlassian.jira.plugin... ]
George Gastaldi commented on FORGE-2273:
----------------------------------------
Unfortunately the Maven model is not flexible enough to allow writing this in a transparent way. The best solution would be to pass a {{SortedProperties}} object to the {{pom.setProperties()}} method, like the following:
{code:java}
/**
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.maven.projects;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
/**
* Introduces an ordered {@link Properties#keySet()}
*
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a>
*/
public class SortedProperties extends Properties
{
private static final long serialVersionUID = 1L;
@Override
public Set<Object> keySet()
{
return new TreeSet<Object>(super.keySet());
}
}
{code}
Then you can do the following before calling setMode():
{code:java}
Model pom = ...
SortedProperties sortedProps = new SortedProperties();
sortedProps.putAll(pom.getProperties());
pom.setProperties(sortedProps);
{code}
> MavenFacet - Write properties sorted A..Z
> -----------------------------------------
>
> Key: FORGE-2273
> URL: https://issues.jboss.org/browse/FORGE-2273
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven
> Affects Versions: 2.15.0.Final
> Reporter: Claus Ibsen
> Priority: Minor
> Labels: Starter
> Fix For: 2.x Future
>
>
> We have a custom addon that adds various commands.
> We have a docket setup command that enables docker to a maven project. And for that we set some values in the <properties> section of the maven pom.xml.
> To update and set those, we use the following code:
> {code}
> // update properties section in pom.xml
> MavenFacet maven = project.getFacet(MavenFacet.class);
> Model pom = maven.getModel();
> Properties properties = pom.getProperties();
> properties.put("docker.registryPrefix", "${env.DOCKER_REGISTRY}/");
> properties.put("docker.from", fromImage);
> properties.put("docker.image", "${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}");
> properties.put("docker.assemblyDescriptorRef", descriptorRef);
> properties.put("docker.port.container.jolokia", "8778");
> if (war) {
> properties.put("docker.port.container.http", "8080");
> }
> // to save then set the model
> maven.setModel(pom);
> {code}
> Which then generates the following in the pom.xml
> {code}
> <properties>
> <docker.port.container.http>8080</docker.port.container.http>
> <docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
> <docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}</docker.image>
> <maven.compiler.target>1.7</maven.compiler.target>
> <docker.port.container.jolokia>8778</docker.port.container.jolokia>
> <docker.from>fabric8/tomcat-8.0</docker.from>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <docker.assemblyDescriptorRef>rootWar</docker.assemblyDescriptorRef>
> <maven.compiler.source>1.7</maven.compiler.source>
> </properties>
> {code}
> Notice the order of the properties is "random". It would be great if forge would sort the properties A..Z so they are more human readable.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-2273) MavenFacet - Write properties sorted A..Z
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2273?page=com.atlassian.jira.plugin... ]
George Gastaldi edited comment on FORGE-2273 at 3/10/15 3:14 PM:
-----------------------------------------------------------------
Unfortunately the Maven model is not flexible enough to allow writing this in a transparent way. The best solution would be to pass a {{SortedProperties}} object to the {{pom.setProperties()}} method, like the following:
{code:java}
/**
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.maven.projects;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
/**
* Introduces an ordered {@link Properties#keySet()}
*
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a>
*/
public class SortedProperties extends Properties
{
private static final long serialVersionUID = 1L;
@Override
public Set<Object> keySet()
{
return new TreeSet<Object>(super.keySet());
}
}
{code}
Then you can do the following before calling {{setModel()}}:
{code:java}
Model pom = ...
SortedProperties sortedProps = new SortedProperties();
sortedProps.putAll(pom.getProperties());
pom.setProperties(sortedProps);
{code}
was (Author: gastaldi):
Unfortunately the Maven model is not flexible enough to allow writing this in a transparent way. The best solution would be to pass a {{SortedProperties}} object to the {{pom.setProperties()}} method, like the following:
{code:java}
/**
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.maven.projects;
import java.util.Properties;
import java.util.Set;
import java.util.TreeSet;
/**
* Introduces an ordered {@link Properties#keySet()}
*
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a>
*/
public class SortedProperties extends Properties
{
private static final long serialVersionUID = 1L;
@Override
public Set<Object> keySet()
{
return new TreeSet<Object>(super.keySet());
}
}
{code}
Then you can do the following before calling setMode():
{code:java}
Model pom = ...
SortedProperties sortedProps = new SortedProperties();
sortedProps.putAll(pom.getProperties());
pom.setProperties(sortedProps);
{code}
> MavenFacet - Write properties sorted A..Z
> -----------------------------------------
>
> Key: FORGE-2273
> URL: https://issues.jboss.org/browse/FORGE-2273
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven
> Affects Versions: 2.15.0.Final
> Reporter: Claus Ibsen
> Priority: Minor
> Labels: Starter
> Fix For: 2.x Future
>
>
> We have a custom addon that adds various commands.
> We have a docket setup command that enables docker to a maven project. And for that we set some values in the <properties> section of the maven pom.xml.
> To update and set those, we use the following code:
> {code}
> // update properties section in pom.xml
> MavenFacet maven = project.getFacet(MavenFacet.class);
> Model pom = maven.getModel();
> Properties properties = pom.getProperties();
> properties.put("docker.registryPrefix", "${env.DOCKER_REGISTRY}/");
> properties.put("docker.from", fromImage);
> properties.put("docker.image", "${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}");
> properties.put("docker.assemblyDescriptorRef", descriptorRef);
> properties.put("docker.port.container.jolokia", "8778");
> if (war) {
> properties.put("docker.port.container.http", "8080");
> }
> // to save then set the model
> maven.setModel(pom);
> {code}
> Which then generates the following in the pom.xml
> {code}
> <properties>
> <docker.port.container.http>8080</docker.port.container.http>
> <docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
> <docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}</docker.image>
> <maven.compiler.target>1.7</maven.compiler.target>
> <docker.port.container.jolokia>8778</docker.port.container.jolokia>
> <docker.from>fabric8/tomcat-8.0</docker.from>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <docker.assemblyDescriptorRef>rootWar</docker.assemblyDescriptorRef>
> <maven.compiler.source>1.7</maven.compiler.source>
> </properties>
> {code}
> Notice the order of the properties is "random". It would be great if forge would sort the properties A..Z so they are more human readable.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-1705) Could not transfer artifact from/to central
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-1705?page=com.atlassian.jira.plugin... ]
Antonio Goncalves commented on FORGE-1705:
------------------------------------------
I just quickly tried. Still the same :
{code}
Using Forge at C:\PROG_RC\IT\Forge\forge-distribution-2.15.0.Final\bin\..
_____
| ___|__ _ __ __ _ ___
| |_ / _ \| `__/ _` |/ _ \ \\
| _| (_) | | | (_| | __/ //
|_| \___/|_| \__, |\___|
|__/
JBoss Forge, version [ 2.15.0.Final ] - JBoss, by Red Hat, Inc. [ http://forge.jboss.org ]
[bin]$ project-new --named test
***SUCCESS*** Project named 'test' has been created.
[test]$ jpa-setup
Downloading: http://repo1.maven.org/maven2/org/hibernate/javax/persistence/hibernate-j...
***ERROR*** Project 'C:\PROG_RC\IT\Forge\forge-distribution-2.15.0.Final\bin\test' has errors
***ERROR*** Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.jboss.spec:jboss-javaee-6.0:pom:3.0.2.Final from/to central (https://repo.maven.apache.org/maven2): Error transfe
rring file: repo.maven.apache.org from https://repo.maven.apache.org/maven2/org/jboss/spec/jboss-javaee-6.0/3.0.... @ line 16, column 19
***ERROR*** Error while executing 'JPA: Connection Settings'
org.jboss.forge.addon.facets.FacetNotFoundException: No Facet of type [interface org.jboss.forge.addon.javaee.jpa.JPAFacet] is installed.
at org.jboss.forge.addon.facets.AbstractFaceted.getFacet(AbstractFaceted.java:51)
at org.jboss.forge.addon.javaee.jpa.PersistenceOperationsImpl.setup(PersistenceOperationsImpl.java:59)
at org.jboss.forge.addon.javaee.jpa.ui.setup.JPASetupConnectionStep.execute(JPASetupConnectionStep.java:262)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)
at org.jboss.forge.addon.javaee.jpa.ui.setup.JPASetupConnectionStep_$$_javassist_e3a11110-c8d8-4826-b862-808c8c7753bb.execute(JPASetupConnectionStep_$$_javassist_e3a11110-c
8d8-4826-b862-808c8c7753bb.java)
at org.jboss.forge.addon.ui.impl.controller.WizardCommandControllerImpl.execute(WizardCommandControllerImpl.java:153)
at org.jboss.forge.addon.ui.impl.controller.NoUIWizardControllerDecorator.execute(NoUIWizardControllerDecorator.java:152)
at org.jboss.forge.addon.shell.aesh.CommandAdapter.execute(CommandAdapter.java:82)
at org.jboss.aesh.console.AeshConsoleImpl$AeshConsoleCallbackImpl.execute(AeshConsoleImpl.java:325)
at org.jboss.aesh.console.AeshProcess.run(AeshProcess.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
***ERROR*** No Facet of type [interface org.jboss.forge.addon.javaee.jpa.JPAFacet] is installed.
[test]$
{code}
> Could not transfer artifact from/to central
> -------------------------------------------
>
> Key: FORGE-1705
> URL: https://issues.jboss.org/browse/FORGE-1705
> Project: Forge
> Issue Type: Task
> Components: Addon Manager
> Affects Versions: 2.3.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> I am at a customer who uses a in-house Artifactory, no direct access to Maven Central. So when I setup JPA for example :
> {code}
> [MyProj]$ jpa-setup
> ***ERROR*** No Facet of type [interface org.jboss.forge.addon.javaee.jpa.JPAFacet] is installed.
> {code}
> I get the following exception :
> {code}
> [ERROR] Non-resolvable import POM: Could not transfer artifact org.jboss.spec:jboss-javaee-6.0:pom:3.0.2.Final from/to central (http://repo.maven.apache.org/maven2): Error transferring file: repo.maven.apache.org from http://repo.maven.apache.org/maven2/org/jboss/spec/jboss-javaee-6.0/3.0.2... @ line 11, column 19
> at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:179) [maven-core-3.1.1.jar:3.1.1]
> at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:105) [maven-core-3.1.1.jar:3.1.1]
> at org.jboss.forge.addon.maven.projects.MavenBuildManager.getProjectBuildingResult(MavenBuildManager.java:88) [maven-impl-projects-2.3.0.Final.jar:2.3.0.Final]
> ... 79 more
> Caused by: org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for org.MyProj:MyProj:1.0.0-SNAPSHOT
> {code}
> So it looks like, by default, it uses the {{http://repo.maven.apache.org/maven2}} which is not accessible. Is there a way not to specify this repository, but instead, rely on Maven configuration (here, the in-house Artifactory repository) ?
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-1705) Could not transfer artifact from/to central
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1705?page=com.atlassian.jira.plugin... ]
George Gastaldi commented on FORGE-1705:
----------------------------------------
Hi [~agoncal],
Can you confirm this is still an issue with 2.15.0.Final?
Thanks
> Could not transfer artifact from/to central
> -------------------------------------------
>
> Key: FORGE-1705
> URL: https://issues.jboss.org/browse/FORGE-1705
> Project: Forge
> Issue Type: Task
> Components: Addon Manager
> Affects Versions: 2.3.0.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> I am at a customer who uses a in-house Artifactory, no direct access to Maven Central. So when I setup JPA for example :
> {code}
> [MyProj]$ jpa-setup
> ***ERROR*** No Facet of type [interface org.jboss.forge.addon.javaee.jpa.JPAFacet] is installed.
> {code}
> I get the following exception :
> {code}
> [ERROR] Non-resolvable import POM: Could not transfer artifact org.jboss.spec:jboss-javaee-6.0:pom:3.0.2.Final from/to central (http://repo.maven.apache.org/maven2): Error transferring file: repo.maven.apache.org from http://repo.maven.apache.org/maven2/org/jboss/spec/jboss-javaee-6.0/3.0.2... @ line 11, column 19
> at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:179) [maven-core-3.1.1.jar:3.1.1]
> at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:105) [maven-core-3.1.1.jar:3.1.1]
> at org.jboss.forge.addon.maven.projects.MavenBuildManager.getProjectBuildingResult(MavenBuildManager.java:88) [maven-impl-projects-2.3.0.Final.jar:2.3.0.Final]
> ... 79 more
> Caused by: org.apache.maven.model.building.ModelBuildingException: 1 problem was encountered while building the effective model for org.MyProj:MyProj:1.0.0-SNAPSHOT
> {code}
> So it looks like, by default, it uses the {{http://repo.maven.apache.org/maven2}} which is not accessible. Is there a way not to specify this repository, but instead, rely on Maven configuration (here, the in-house Artifactory repository) ?
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years
[JBoss JIRA] (FORGE-2273) MavenFacet - Write properties sorted A..Z
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-2273?page=com.atlassian.jira.plugin... ]
George Gastaldi updated FORGE-2273:
-----------------------------------
Labels: Starter (was: )
> MavenFacet - Write properties sorted A..Z
> -----------------------------------------
>
> Key: FORGE-2273
> URL: https://issues.jboss.org/browse/FORGE-2273
> Project: Forge
> Issue Type: Enhancement
> Components: Build Tools - Maven
> Affects Versions: 2.15.0.Final
> Reporter: Claus Ibsen
> Priority: Minor
> Labels: Starter
> Fix For: 2.x Future
>
>
> We have a custom addon that adds various commands.
> We have a docket setup command that enables docker to a maven project. And for that we set some values in the <properties> section of the maven pom.xml.
> To update and set those, we use the following code:
> {code}
> // update properties section in pom.xml
> MavenFacet maven = project.getFacet(MavenFacet.class);
> Model pom = maven.getModel();
> Properties properties = pom.getProperties();
> properties.put("docker.registryPrefix", "${env.DOCKER_REGISTRY}/");
> properties.put("docker.from", fromImage);
> properties.put("docker.image", "${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}");
> properties.put("docker.assemblyDescriptorRef", descriptorRef);
> properties.put("docker.port.container.jolokia", "8778");
> if (war) {
> properties.put("docker.port.container.http", "8080");
> }
> // to save then set the model
> maven.setModel(pom);
> {code}
> Which then generates the following in the pom.xml
> {code}
> <properties>
> <docker.port.container.http>8080</docker.port.container.http>
> <docker.registryPrefix>${env.DOCKER_REGISTRY}/</docker.registryPrefix>
> <docker.image>${docker.registryPrefix}fabric8/${project.artifactId}:${project.version}</docker.image>
> <maven.compiler.target>1.7</maven.compiler.target>
> <docker.port.container.jolokia>8778</docker.port.container.jolokia>
> <docker.from>fabric8/tomcat-8.0</docker.from>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <docker.assemblyDescriptorRef>rootWar</docker.assemblyDescriptorRef>
> <maven.compiler.source>1.7</maven.compiler.source>
> </properties>
> {code}
> Notice the order of the properties is "random". It would be great if forge would sort the properties A..Z so they are more human readable.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
11 years