Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines/client.test.live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ queue:
steps:
- bash: |
LOG_PARAMS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
mvn test -Dhttp.keepAlive=false -Dsurefire.rerunFailingTestsCount=3 $LOG_PARAMS -f pom.client.build.xml
mvn test -Dhttp.keepAlive=false -Dsurefire.rerunFailingTestsCount=3 $LOG_PARAMS -f pom.client.xml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the client.yml? Is the plan to update the pipeline variable after this merges? We should consider adding a variable for this project file as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the client.test.live.yml file to have pomFile variable.

displayName: 'Run Live Tests'
env:
ARM_CLIENTID: $(ARM_CLIENTID)
Expand Down
12 changes: 6 additions & 6 deletions keyvault/data-plane/azure-keyvault-complete/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ the MIT License. See License.txt in the project root for license information. --
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-parent</artifactId>
<version>1.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-parent</artifactId>
<version>1.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-complete</artifactId>
Expand Down Expand Up @@ -42,7 +42,7 @@ the MIT License. See License.txt in the project root for license information. --
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
<name>Microsoft Corporation</name>
</developer>
</developers>

Expand Down
30 changes: 3 additions & 27 deletions keyvault/data-plane/azure-keyvault-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.microsoft.azure</groupId>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this defaulted from the parent POM? Is there any reason to duplicated in the individual projects?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should default the other properties like versioning and developer, etc in the parent POM as well to avoid needing them in all the individual projects.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The group Ids were introduced to improve readability. Other properties already existed.
Helps to add dependency for the project, without looking at other poms for info about group Ids or versions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might help with some local views of the project but it adds more harm then good in my opinion as it enables more projects to stay in sync, in particular for the version number, the fewer places we have to edit that the better. So I still suggest that a number of common properties should be lifted into one of the parent POM's in the structure. Of course that can happen as a clean-up PR and not block this PR.

@JonathanGiles JonathanGiles Jan 26, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine to centralise versions where it makes sense. I would rather not centralise group ID for now though. I would say this should be done subsequently so that it does not hold merging. We should get this merged ASAP

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

<artifactId>azure-keyvault-core</artifactId>
<version>1.2.0</version>
<packaging>jar</packaging>
Expand Down Expand Up @@ -42,7 +43,7 @@
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
<name>Microsoft Corporation</name>
</developer>
</developers>

Expand All @@ -64,7 +65,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
Expand All @@ -74,36 +74,12 @@
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>

</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<excludePackageNames>com.microsoft.schemas._2003._10.serialization</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>
34 changes: 26 additions & 8 deletions keyvault/data-plane/azure-keyvault-cryptography/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-parent</artifactId>
<version>1.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-parent</artifactId>
<artifactId>azure-keyvault-cryptography</artifactId>
<version>1.2.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>azure-keyvault-cryptography</artifactId>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Key Vault Cryptography</name>
Expand Down Expand Up @@ -84,6 +85,23 @@
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<scope>test</scope>
</dependency>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<outputDirectory>${basedir}/target/test-classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/test/resources</directory>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.microsoft.azure.keyvault.cryptography.algorithms.Es384;
import com.microsoft.azure.keyvault.cryptography.algorithms.Es512;
import com.microsoft.azure.keyvault.cryptography.SignatureEncoding;
import com.microsoft.azure.keyvault.cryptography.test.resources.PemFile;
import com.microsoft.azure.keyvault.webkey.JsonWebKey;
import com.microsoft.azure.keyvault.webkey.JsonWebKeyCurveName;
import com.microsoft.azure.keyvault.webkey.JsonWebKeyType;
Expand Down Expand Up @@ -83,8 +82,8 @@ protected static void setProvider(Provider provider) {
public static void setUpBeforeClass() throws Exception {
setProvider(Security.getProvider("SunEC"));
EC_KEY_GENERATOR = KeyPairGenerator.getInstance("EC", _provider);
Path byte_location = Paths.get("src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/byte_array.bin");

Path byte_location = Paths.get(getPath("byte_array.bin"));
CEK = Files.readAllBytes(byte_location);

FACTORY = KeyFactory.getInstance("EC", _provider);
Expand Down Expand Up @@ -220,16 +219,25 @@ private KeyPair getKeyFromFile(String privateKeyPath, String publicKeyPath) thro
}

private void testFromFile(String keyType, MessageDigest digest, String algorithm) throws Exception {
String privateKeyPath = "src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/" + keyType + "keynew.pem";
String publicKeyPath = "src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/" + keyType + "keypubnew.pem";
String privateKeyPath = getPath(keyType+"keynew.pem");
String publicKeyPath = getPath(keyType+"keypubnew.pem");

EcKey newKey = new EcKey("akey", getKeyFromFile(privateKeyPath, publicKeyPath));

Path signatureLocation = Paths.get("src/test/java/com/microsoft/azure/keyvault/cryptography/test/resources/" + keyType + "sig.der");
Path signatureLocation = Paths.get(getPath(keyType+"sig.der"));
byte[] signature = SignatureEncoding.fromAsn1Der(Files.readAllBytes(signatureLocation), algorithm);

doVerify(newKey, digest, signature);
}

private static String getPath(String filename){

String path = ECKeyTest.class.getClassLoader().getResource(filename).getPath();
if(path.contains(":")){
path = path.substring(1);
}
return path;
}

@Test
public void testCreateSECP256K1Key() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.microsoft.azure.keyvault.cryptography.test.resources;
package com.microsoft.azure.keyvault.cryptography.test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
Expand Down
40 changes: 5 additions & 35 deletions keyvault/data-plane/azure-keyvault-extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
<name>Microsoft Corporation</name>
</developer>
</developers>

Expand All @@ -67,10 +67,6 @@
</dependency>

<!-- Other Microsoft Azure Dependencies -->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
Expand Down Expand Up @@ -102,15 +98,14 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
<version>1.3.1-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<scope>test</scope>
</dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<scope>test</scope>
</dependency>

<!-- Other Dependencies -->
<dependency>
Expand All @@ -136,7 +131,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
Expand All @@ -149,32 +143,8 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>
27 changes: 1 addition & 26 deletions keyvault/data-plane/azure-keyvault-webkey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<artifactId>azure-keyvault-webkey</artifactId>
<version>1.2.0</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Key Vault WebKey</name>
Expand Down Expand Up @@ -84,7 +84,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
Expand All @@ -97,32 +96,8 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<excludePackageNames>com.microsoft.schemas._2003._10.serialization;</excludePackageNames>
<bottom><![CDATA[<code>/**
<br />* Copyright (c) Microsoft Corporation. All rights reserved.
<br />* Licensed under the MIT License. See License.txt in the project root for
<br />* license information.
<br />*/</code>]]></bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading