Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation too strict #278

Open
nox-4O4 opened this issue Apr 4, 2023 · 1 comment
Open

Validation too strict #278

nox-4O4 opened this issue Apr 4, 2023 · 1 comment
Labels
good first issue Good for newcomers. to grab Ready to do and to grab by those willing.

Comments

@nox-4O4
Copy link

nox-4O4 commented Apr 4, 2023

The validation for required configuration elements is too strict. E.g., all proxy settings are optional (see https://maven.apache.org/xsd/settings-1.0.0.xsd, note the minOccurs="0") and some even have default values.

View XSD schema part
<xs:complexType name="Proxy">
	<xs:annotation>
		<xs:documentation source="version">1.0.0</xs:documentation>
		<xs:documentation source="description">The
			<code>&lt;proxy&gt;</code>
			element contains informations required to a proxy settings.
		</xs:documentation>
	</xs:annotation>
	<xs:all>
		<xs:element minOccurs="0" name="active" type="xs:boolean" default="false">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">Whether this proxy configuration is the active one.</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="protocol" type="xs:string" default="http">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">The proxy protocol.</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="username" type="xs:string">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">The proxy user.</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="password" type="xs:string">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">The proxy password.</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="port" type="xs:int" default="8080">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">The proxy port.</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="host" type="xs:string">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">The proxy host.</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="nonProxyHosts" type="xs:string">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
				<xs:documentation source="description">The list of non-proxied hosts (delimited by |).</xs:documentation>
			</xs:annotation>
		</xs:element>
		<xs:element minOccurs="0" name="id" type="xs:string">
			<xs:annotation>
				<xs:documentation source="version">1.0.0</xs:documentation>
			</xs:annotation>
		</xs:element>
	</xs:all>
</xs:complexType>

Omitting optional settings currently leads to following error: proxies must contain id, active, protocol, host, port and nonProxyHosts.

To reproduce
Use following step in your GitHub action:

    - name: Configure Maven
      uses: s4u/[email protected]
      with:
          proxies: '[{"active": "true", "protocol": "https", "host": "proxy.host", "username": "proxy_user", "password": "proxy_password", "nonProxyHosts": ""}]'

This will result in following error: proxies must contain id, active, protocol, host, port and nonProxyHosts, even when those settings are specified but empty ("nonProxyHosts": "").

Expected behavior
Should create settings.xml with specified settings.

@slawekjaranowski
Copy link
Member

PR are welcome

@slawekjaranowski slawekjaranowski added good first issue Good for newcomers. to grab Ready to do and to grab by those willing. labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers. to grab Ready to do and to grab by those willing.
Development

No branches or pull requests

2 participants