From df41e8f53536be3e479e0f9dd569fb3df3bea60a Mon Sep 17 00:00:00 2001
From: Benjamin Bentmann <bentmann@apache.org>
Date: Thu, 5 Mar 2009 21:44:15 +0000
Subject: [PATCH] [MNG-4068] [regression] Use proper id for mirrored repository

o Added IT

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@750609 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/maven/it/IntegrationTestSuite.java |   1 +
 ...MavenITmng4068AuthenticatedMirrorTest.java | 131 ++++++++++++++++++
 .../src/test/resources/mng-4068/pom.xml       |  72 ++++++++++
 .../apache/maven/its/mng4068/a/0.1/a-0.1.jar  | Bin 0 -> 1930 bytes
 .../apache/maven/its/mng4068/a/0.1/a-0.1.pom  |  36 +++++
 .../maven/its/mng4068/a/maven-metadata.xml    |  13 ++
 .../0.1-SNAPSHOT/b-0.1-20090305.203819-1.jar  | Bin 0 -> 1947 bytes
 .../0.1-SNAPSHOT/b-0.1-20090305.203819-1.pom  |  36 +++++
 .../mng4068/b/0.1-SNAPSHOT/maven-metadata.xml |  13 ++
 .../maven/its/mng4068/b/maven-metadata.xml    |  12 ++
 .../resources/mng-4068/settings-template.xml  |  59 ++++++++
 11 files changed, 373 insertions(+)
 create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/pom.xml
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.jar
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.pom
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/maven-metadata.xml
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.jar
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.pom
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/maven-metadata.xml
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/maven-metadata.xml
 create mode 100644 its/core-it-suite/src/test/resources/mng-4068/settings-template.xml

diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index 4b9bf7fcf0..72de1fedf1 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -91,6 +91,7 @@ public static Test suite()
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng4068AuthenticatedMirrorTest.class );
         suite.addTestSuite( MavenITmng4056ClassifierBasedDepResolutionFromReactorTest.class );
         suite.addTestSuite( MavenITmng4053PluginConfigAttributesTest.class );
         suite.addTestSuite( MavenITmng4040ProfileInjectedModulesTest.class );
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java
new file mode 100644
index 0000000000..b399f304d6
--- /dev/null
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4068AuthenticatedMirrorTest.java
@@ -0,0 +1,131 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.util.Properties;
+
+import org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.DefaultHandler;
+import org.mortbay.jetty.handler.HandlerList;
+import org.mortbay.jetty.handler.ResourceHandler;
+import org.mortbay.jetty.security.Constraint;
+import org.mortbay.jetty.security.ConstraintMapping;
+import org.mortbay.jetty.security.HashUserRealm;
+import org.mortbay.jetty.security.SecurityHandler;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4068">MNG-4068</a>.
+ * 
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng4068AuthenticatedMirrorTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    private File testDir;
+
+    private Server server;
+
+    private int port;
+
+    public MavenITmng4068AuthenticatedMirrorTest()
+    {
+        super( ALL_MAVEN_VERSIONS );
+    }
+
+    public void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4068" );
+
+        Constraint constraint = new Constraint();
+        constraint.setName( Constraint.__BASIC_AUTH );
+        constraint.setRoles( new String[] { "user" } );
+        constraint.setAuthenticate( true );
+
+        ConstraintMapping constraintMapping = new ConstraintMapping();
+        constraintMapping.setConstraint( constraint );
+        constraintMapping.setPathSpec( "/*" );
+
+        HashUserRealm userRealm = new HashUserRealm( "TestRealm" );
+        userRealm.put( "testuser", "testtest" );
+        userRealm.addUserToRole( "testuser", "user" );
+
+        SecurityHandler securityHandler = new SecurityHandler();
+        securityHandler.setUserRealm( userRealm );
+        securityHandler.setConstraintMappings( new ConstraintMapping[] { constraintMapping } );
+
+        ResourceHandler repoHandler = new ResourceHandler();
+        repoHandler.setResourceBase( new File( testDir, "repo" ).getAbsolutePath() );
+
+        HandlerList handlerList = new HandlerList();
+        handlerList.addHandler( securityHandler );
+        handlerList.addHandler( repoHandler );
+        handlerList.addHandler( new DefaultHandler() );
+
+        server = new Server( 0 );
+        server.setHandler( handlerList );
+        server.start();
+
+        port = server.getConnectors()[0].getLocalPort();
+    }
+
+    protected void tearDown()
+        throws Exception
+    {
+        if ( server != null )
+        {
+            server.stop();
+        }
+
+        super.tearDown();
+    }
+
+    /**
+     * Test that downloading of release/snapshot artifacts from an authenticated mirror works. This basically boils down
+     * to using the proper id for the mirrored repository when looking up the credentials.
+     */
+    public void testit()
+        throws Exception
+    {
+        Properties filterProps = new Properties();
+        filterProps.setProperty( "@mirrorPort@", Integer.toString( port ) );
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps );
+        verifier.setAutoclean( false );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng4068" );
+        verifier.getCliOptions().add( "--settings" );
+        verifier.getCliOptions().add( "settings.xml" );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertArtifactPresent( "org.apache.maven.its.mng4068", "a", "0.1", "jar" );
+        verifier.assertArtifactPresent( "org.apache.maven.its.mng4068", "b", "0.1-SNAPSHOT", "jar" );
+    }
+
+}
diff --git a/its/core-it-suite/src/test/resources/mng-4068/pom.xml b/its/core-it-suite/src/test/resources/mng-4068/pom.xml
new file mode 100644
index 0000000000..3874d95e80
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/pom.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4068</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-4068</name> 
+  <description>
+    Test that downloading of release/snapshot artifacts from an authenticated mirror works. This basically
+    boils down to using the proper id for the mirrored repository when looking up the credentials.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <!-- test a release artifact -->
+      <groupId>org.apache.maven.its.mng4068</groupId>
+      <artifactId>a</artifactId>
+      <version>0.1</version>
+    </dependency>
+    <dependency>
+      <!-- test a snapshot artifact -->
+      <groupId>org.apache.maven.its.mng4068</groupId>
+      <artifactId>b</artifactId>
+      <version>0.1-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <compileClassPath>target/classpath.txt</compileClassPath>
+        </configuration>
+        <executions>
+          <execution>
+            <id>test</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.jar b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.jar
new file mode 100644
index 0000000000000000000000000000000000000000..ffad6800a23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$$hk>KRYzRbd7V7SnuM(GyitnjuM$3wbeID<;j_IOJ?m~(8H2jr+a$y$M(-N
z-fsFOv~F$0$2*s19)I)VihKL=**%Ld&)EB>J+Nh${pU#<YW^|D-xSC!c(Zn4SANVS
zt#^OFZWXzDLqqvRXI`81E@9V8&Ai1`#};ld6h5kW>y=jFZC~vZ_x{Bc{qpAc+r87x
zu=wCY<KL@G&;09d33%`Nj~A9-Il!fj$c8(wi-C!}6o_reO6&zi`30#(C7G$k!Daqu
zy>-2GJbeQ_R)u`<)$u<2_-PQ|Ne$Lb-6A|bqCGrodvw?EoDrE5>nzg4!=qEV^HflG
zm+|M%IlNzZDtBJ${^ZSV6P)w8`_fk-a1r#i$Z^?=)M+BGpFUeUTVh7!hay$6sVU1;
z)uuCus(mVA1QtGwOd`y<3s0brfIxuZts{s=DoSD6uotEv#UQYxQ5{IawILO)_$&sM
zdk_G!cps1nHvv`(!mP($4k9$a#?(xpRK#sEs9b~qkh4q~F`R|hWKbyyGaGw32{V03
yV<X9CLrYC$D?oK2dg?@2kq0cC(L$Ag^FdZ1(rSP=D;vl(b|AC_7WUSxARYjY1Ea+N

literal 0
HcmV?d00001

diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.pom b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.pom
new file mode 100644
index 0000000000..2a48a3637b
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/0.1/a-0.1.pom
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4068</groupId>
+  <artifactId>a</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+</project>
diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/maven-metadata.xml
new file mode 100644
index 0000000000..ea7be19e6b
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/a/maven-metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.maven.its.mng4068</groupId>
+  <artifactId>a</artifactId>
+  <version>0.1</version>
+  <versioning>
+    <release>0.1</release>
+    <versions>
+      <version>0.1</version>
+    </versions>
+    <lastUpdated>20090305203807</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.jar b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.jar
new file mode 100644
index 0000000000000000000000000000000000000000..a376eaa7a0ab92e1508b22f597a17f666eff09e9
GIT binary patch
literal 1947
zcmWIWW@h1H0D)6$Qmw!YD8UJ&eO*Hwbv^yu^aG&EI2cX>m7Tqn#*_+_t_ETeWM#gN
zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${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vc0d6<X!QX>Hg;Pz8)1j`^#4Ky_xk`Z_;;ragloQ
zn7>Nf0zGmH-uV2>lAZKl$?=Ny)_P`GzU2UyIyY@v1#5tby$*<N$V&7DMfnA(MJ1W3
z#ldC%XT5d3bUb|nJywN$@YV4?`}k=P-$@PDP2D0qKB7H5YkPFp@aT%piFFp~;o;G#
z+<7XfyUY0V=N#TIJf+QlWtf|6|2S9dywv^4o7*Nh=X3X^uR`E5>1&bWv6rdSL|#9A
zwsf|{jK~i~s$x@9mZ_>uXAo8USi}e{jTo6km~oe;K(7IT0K;2H5RFu}!n9#8T|tUL
zU`eAokc4YPDr@ms3@QjA0A%q#AQNr^tXPCukG)_-Xnu{UnLsg#+hkBd2>~EynKEKH
z3$MwbViRUI_JR{;`jW;*lFfz|qsUf(Do6BWim;*#SX!fnDgoz%tUx5%0B=?{kZJ5d
MXbCL+eON&}03~IWUjP6A

literal 0
HcmV?d00001

diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.pom b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.pom
new file mode 100644
index 0000000000..d00b2737f0
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/b-0.1-20090305.203819-1.pom
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4068</groupId>
+  <artifactId>b</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+</project>
diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/maven-metadata.xml
new file mode 100644
index 0000000000..af58c00812
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/0.1-SNAPSHOT/maven-metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.maven.its.mng4068</groupId>
+  <artifactId>b</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <versioning>
+    <snapshot>
+      <timestamp>20090305.203819</timestamp>
+      <buildNumber>1</buildNumber>
+    </snapshot>
+    <lastUpdated>20090305203819</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/maven-metadata.xml
new file mode 100644
index 0000000000..a25d63ca63
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/repo/org/apache/maven/its/mng4068/b/maven-metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.maven.its.mng4068</groupId>
+  <artifactId>b</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <versioning>
+    <versions>
+      <version>0.1-SNAPSHOT</version>
+    </versions>
+    <lastUpdated>20090305203819</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/its/core-it-suite/src/test/resources/mng-4068/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4068/settings-template.xml
new file mode 100644
index 0000000000..26951cacb5
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4068/settings-template.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings>
+  <mirrors>
+    <mirror>
+      <!-- NOTE: The id of the mirror should be used to lookup the credentials, not the id of the original repository. -->
+      <id>maven-core-it-mng-4068</id>
+      <name>Test Mirror</name>
+      <mirrorOf>central</mirrorOf>
+      <url>http://localhost:@mirrorPort@/</url>
+    </mirror>
+  </mirrors>
+  <servers>
+    <server>
+      <id>maven-core-it-mng-4068</id>
+      <username>testuser</username>
+      <password>testtest</password>
+    </server>
+  </servers>
+  <profiles>
+    <profile>
+      <id>mng-4068</id>
+      <repositories>
+        <repository>
+          <id>central</id>
+          <url>file://null</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+          </releases>
+          <snapshots>
+            <checksumPolicy>ignore</checksumPolicy>
+          </snapshots>
+        </repository>
+      </repositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>mng-4068</activeProfile>
+  </activeProfiles>
+</settings>