Skip to content

Commit

Permalink
[MDEP-739] Dependency Plugin go-offline doesn't respect artifact clas…
Browse files Browse the repository at this point in the history
…sifier

Closes #133
  • Loading branch information
van-vliet authored and slachiewicz committed Jun 1, 2021
1 parent 205c1a7 commit b0942a6
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
@@ -0,0 +1,18 @@
# 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.

invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:go-offline
38 changes: 38 additions & 0 deletions src/it/projects/mdep-739-go-offline-respect-classifiers/pom.xml
@@ -0,0 +1,38 @@
<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
<groupId>org.apache.maven.plugins.dependency</groupId>
<artifactId>mdep-739-go-offline-respect-classifiers</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description>Test that dependency:go-offline respects classifiers on artifacts</description>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
<scope>test</scope>
<type>test-jar</type>
<classifier>test-binder</classifier>
<version>3.1.2</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,26 @@
/*
* 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.
*/

File file = new File( basedir, "build.log" );
assert file.exists();

String buildLog = file.getText( "UTF-8" );
assert buildLog.contains( 'Resolved dependency: spring-cloud-stream-3.1.2-test-binder.jar' );

return true;
Expand Up @@ -187,6 +187,7 @@ private DependableCoordinate createDependendableCoordinateFromArtifact( final Ar
result.setArtifactId( artifact.getArtifactId() );
result.setVersion( artifact.getVersion() );
result.setType( artifact.getType() );
result.setClassifier( artifact.getClassifier() );

return result;
}
Expand All @@ -198,6 +199,7 @@ private DependableCoordinate createDependendableCoordinateFromDependency( final
result.setArtifactId( dependency.getArtifactId() );
result.setVersion( dependency.getVersion() );
result.setType( dependency.getType() );
result.setClassifier( dependency.getClassifier() );

return result;
}
Expand Down

0 comments on commit b0942a6

Please sign in to comment.