rspec/rules/S3422/xml/rule.adoc
2024-10-14 13:56:35 +02:00

57 lines
1.2 KiB
Plaintext

== Why is this an issue?
``++system++`` dependencies are sought at a specific, specified path. This drastically reduces portability because if you deploy your artifact in an environment that's not configured just like yours is, your code won't work.
=== Noncompliant code example
[source,xml,diff-id=1,diff-type=noncompliant]
----
<dependency>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
<version>2.0</version>
<scope>system</scope> <!-- Noncompliant -->
<systemPath>/usr/bin/lib/rt.jar</systemPath> <!-- remove this -->
</dependency>
----
=== Compliant solution
[source,xml,diff-id=1,diff-type=compliant]
----
<dependency>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Update this scope and remove the "systemPath".
=== Highlighting
scope value
2ndary: entire systemPath tag
'''
== Comments And Links
(visible only on this page)
=== on 30 Nov 2015, 14:17:58 Michael Gumowski wrote:
LGTM [~ann.campbell.2]!
endif::env-github,rspecator-view[]