summaryrefslogtreecommitdiff
path: root/spec/integration/java
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/java')
-rw-r--r--spec/integration/java/maven_spec.rb33
1 files changed, 13 insertions, 20 deletions
diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb
index ad083bb..9b0ee45 100644
--- a/spec/integration/java/maven_spec.rb
+++ b/spec/integration/java/maven_spec.rb
@@ -5,31 +5,24 @@ RSpec.describe "maven" do
describe "When the maven dependencies come from a custom public maven repository" do
it 'is able to detect some of the licenses' do
- runner.add_file('pom.xml') do
- <<~XML
-<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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.gitlab.secure</groupId>
- <artifactId>license-scanning</artifactId>
- <packaging>jar</packaging>
- <version>1.0-SNAPSHOT</version>
- <name>example</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>com.gitlab.xlgmokha</groupId>
- <artifactId>mvn-spike</artifactId>
- <version>1.2-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
- XML
- end
+ runner.add_file('pom.xml', fixture_file_content('pom-public-gitlab-repository.xml'))
report = runner.scan(env: { 'CI_PROJECT_ID' => '17523603' })
expect(report).to match_schema(version: '2.0')
expect(report[:dependencies]).to match_array([{ name: 'mvn-spike', url: '', description: '', paths: ['.'], licenses: ['MIT'] }])
end
+
+ it 'downloads packages from by using a custom `settings.xml`' do
+ runner.add_file('pom.xml', fixture_file_content('pom-public-gitlab-repository.xml'))
+ runner.add_file('my_settings.xml', fixture_file_content(' custom-maven-settings.xml'))
+
+ report = runner.scan(env: {
+ 'LICENSE_FINDER_CLI_OPTS' => '--maven-options="-S my_settings.xml"'
+ })
+
+ expect(report).to match_schema(version: '2.0')
+ expect(report[:dependencies]).to match_array([{ name: 'mvn-spike', url: '', description: '', paths: ['.'], licenses: ['MIT'] }])
+ end
end
end