This is an automated email from the ASF dual-hosted git repository. sjaranowski pushed a commit to branch runtime-provided-verbose in repository https://gitbox.apache.org/repos/asf/maven-dependency-tree.git
commit ffe3786577972fe100fecb34da8c1e0086e102ae Author: Slawomir Jaranowski <[email protected]> AuthorDate: Mon Jun 13 23:51:29 2022 +0200 runtime-provided-verbose tests --- .../compile-provided-verbose/expected-default.txt | 2 + .../compile-provided-verbose/expected-verbose.txt | 9 +++ src/it/compile-provided-verbose/invoker.properties | 20 ++++++ src/it/compile-provided-verbose/pom.xml | 80 ++++++++++++++++++++++ src/it/compile-provided-verbose/verify.groovy | 30 ++++++++ .../runtime-provided-verbose/expected-default.txt | 2 + .../runtime-provided-verbose/expected-verbose.txt | 1 + src/it/runtime-provided-verbose/invoker.properties | 20 ++++++ src/it/runtime-provided-verbose/pom.xml | 80 ++++++++++++++++++++++ src/it/runtime-provided-verbose/verify.groovy | 30 ++++++++ 10 files changed, 274 insertions(+) diff --git a/src/it/compile-provided-verbose/expected-default.txt b/src/it/compile-provided-verbose/expected-default.txt new file mode 100644 index 0000000..7af26b1 --- /dev/null +++ b/src/it/compile-provided-verbose/expected-default.txt @@ -0,0 +1,2 @@ +org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT +\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile diff --git a/src/it/compile-provided-verbose/expected-verbose.txt b/src/it/compile-provided-verbose/expected-verbose.txt new file mode 100644 index 0000000..5036f21 --- /dev/null +++ b/src/it/compile-provided-verbose/expected-verbose.txt @@ -0,0 +1,9 @@ +org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT +\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:compile + +- jakarta.enterprise:jakarta.enterprise.cdi-api:jar:3.0.1:provided + | +- jakarta.el:jakarta.el-api:jar:4.0.0:provided + | +- (jakarta.interceptor:jakarta.interceptor-api:jar:2.0.1:provided - omitted for duplicate) + | +- jakarta.inject:jakarta.inject-api:jar:2.0.1:provided + | \- jakarta.ejb:jakarta.ejb-api:jar:4.0.0:provided + \- jakarta.interceptor:jakarta.interceptor-api:jar:2.0.1:provided + \- jakarta.annotation:jakarta.annotation-api:jar:2.0.0:provided diff --git a/src/it/compile-provided-verbose/invoker.properties b/src/it/compile-provided-verbose/invoker.properties new file mode 100644 index 0000000..55442dc --- /dev/null +++ b/src/it/compile-provided-verbose/invoker.properties @@ -0,0 +1,20 @@ +# 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 = clean validate +# Maven 2 makes wrong resolution +invoker.maven.version = 3.0+ diff --git a/src/it/compile-provided-verbose/pom.xml b/src/it/compile-provided-verbose/pom.xml new file mode 100644 index 0000000..6923653 --- /dev/null +++ b/src/it/compile-provided-verbose/pom.xml @@ -0,0 +1,80 @@ +<?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.its.dependency-tree</groupId> + <artifactId>verbose</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>VerboseTest</name> + <description> + Test verbose dependency-tree - artifact with provided dependency in compile scope + </description> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <dependencies> + <dependency> + <groupId>jakarta.transaction</groupId> + <artifactId>jakarta.transaction-api</artifactId> + <version>2.0.1</version> + <scope>compile</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.dependency-tree</groupId> + <artifactId>graph-maven-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>verbose</id> + <phase>validate</phase> + <configuration> + <outputFile>target/tree-verbose.txt</outputFile> + <verbose>true</verbose> + </configuration> + <goals> + <goal>graph</goal> + </goals> + </execution> + <execution> + <id>default</id> + <phase>validate</phase> + <configuration> + <outputFile>target/tree-default.txt</outputFile> + </configuration> + <goals> + <goal>graph</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/src/it/compile-provided-verbose/verify.groovy b/src/it/compile-provided-verbose/verify.groovy new file mode 100644 index 0000000..2065d47 --- /dev/null +++ b/src/it/compile-provided-verbose/verify.groovy @@ -0,0 +1,30 @@ +/* + * 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. + */ + +def actual = new File( basedir, "target/tree-verbose.txt" ).readLines() +// omitted for cycle not supported anymore, but should probably return +// omitted for exclusion is not supported yet +def expected = new File( basedir, "expected-verbose.txt" ).readLines().findAll{!((it.contains('omitted for cycle')||it.contains('omitted for exclusion')))} + +assert actual.equals( expected ) + +actual = new File( basedir, "target/tree-default.txt" ).readLines() +expected = new File( basedir, "expected-default.txt" ).readLines() + +assert actual.equals( expected ) \ No newline at end of file diff --git a/src/it/runtime-provided-verbose/expected-default.txt b/src/it/runtime-provided-verbose/expected-default.txt new file mode 100644 index 0000000..248710b --- /dev/null +++ b/src/it/runtime-provided-verbose/expected-default.txt @@ -0,0 +1,2 @@ +org.apache.maven.its.dependency-tree:verbose:jar:1.0-SNAPSHOT +\- jakarta.transaction:jakarta.transaction-api:jar:2.0.1:runtime diff --git a/src/it/runtime-provided-verbose/expected-verbose.txt b/src/it/runtime-provided-verbose/expected-verbose.txt new file mode 100644 index 0000000..be10852 --- /dev/null +++ b/src/it/runtime-provided-verbose/expected-verbose.txt @@ -0,0 +1 @@ +??? diff --git a/src/it/runtime-provided-verbose/invoker.properties b/src/it/runtime-provided-verbose/invoker.properties new file mode 100644 index 0000000..55442dc --- /dev/null +++ b/src/it/runtime-provided-verbose/invoker.properties @@ -0,0 +1,20 @@ +# 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 = clean validate +# Maven 2 makes wrong resolution +invoker.maven.version = 3.0+ diff --git a/src/it/runtime-provided-verbose/pom.xml b/src/it/runtime-provided-verbose/pom.xml new file mode 100644 index 0000000..24acc34 --- /dev/null +++ b/src/it/runtime-provided-verbose/pom.xml @@ -0,0 +1,80 @@ +<?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.its.dependency-tree</groupId> + <artifactId>verbose</artifactId> + <version>1.0-SNAPSHOT</version> + + <name>VerboseTest</name> + <description> + Test verbose dependency-tree - artifact with provided dependency in runtime scope + </description> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <dependencies> + <dependency> + <groupId>jakarta.transaction</groupId> + <artifactId>jakarta.transaction-api</artifactId> + <version>2.0.1</version> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.dependency-tree</groupId> + <artifactId>graph-maven-plugin</artifactId> + <version>1.0-SNAPSHOT</version> + <executions> + <execution> + <id>verbose</id> + <phase>validate</phase> + <configuration> + <outputFile>target/tree-verbose.txt</outputFile> + <verbose>true</verbose> + </configuration> + <goals> + <goal>graph</goal> + </goals> + </execution> + <execution> + <id>default</id> + <phase>validate</phase> + <configuration> + <outputFile>target/tree-default.txt</outputFile> + </configuration> + <goals> + <goal>graph</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/src/it/runtime-provided-verbose/verify.groovy b/src/it/runtime-provided-verbose/verify.groovy new file mode 100644 index 0000000..2065d47 --- /dev/null +++ b/src/it/runtime-provided-verbose/verify.groovy @@ -0,0 +1,30 @@ +/* + * 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. + */ + +def actual = new File( basedir, "target/tree-verbose.txt" ).readLines() +// omitted for cycle not supported anymore, but should probably return +// omitted for exclusion is not supported yet +def expected = new File( basedir, "expected-verbose.txt" ).readLines().findAll{!((it.contains('omitted for cycle')||it.contains('omitted for exclusion')))} + +assert actual.equals( expected ) + +actual = new File( basedir, "target/tree-default.txt" ).readLines() +expected = new File( basedir, "expected-default.txt" ).readLines() + +assert actual.equals( expected ) \ No newline at end of file
