Skip to content

Commit

Permalink
merged maven-dependency-analyzer-1.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredstehler committed May 17, 2024
2 parents 950c52a + e041018 commit 91136d9
Show file tree
Hide file tree
Showing 31 changed files with 745 additions and 124 deletions.
14 changes: 5 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ updates:
directory: "/"
schedule:
interval: daily
time: '04:00'
open-pull-requests-limit: 10
ignore:
- dependency-name: org.apache.maven:*
versions:
- "> 3.1.1"
# Ignore Maven 3.2.1+
- dependency-name: org.apache.maven.plugin-testing:maven-plugin-testing-tools
versions:
- ">=3.2.0"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
26 changes: 26 additions & 0 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
@@ -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.
name: Java CI

on:
push:
pull_request:

jobs:
build:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
56 changes: 26 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
<parent>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-components</artifactId>
<version>39</version>
<version>42</version>
<relativePath />
</parent>

<artifactId>maven-dependency-analyzer</artifactId>
<version>1.13.3-SNAPSHOT</version>
<version>1.14.0</version>
<packaging>jar</packaging>

<name>Apache Maven Dependency Analyzer</name>
Expand All @@ -38,7 +38,7 @@
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-dependency-analyzer.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-dependency-analyzer.git</developerConnection>
<tag>HEAD</tag>
<tag>maven-dependency-analyzer-1.14.0</tag>
<url>https://github.com/apache/maven-dependency-analyzer/tree/${project.scm.tag}</url>
</scm>
<issueManagement>
Expand All @@ -57,73 +57,70 @@
</distributionManagement>

<properties>
<mavenVersion>3.2.5</mavenVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<mavenVersion>3.9.6</mavenVersion>
<javaVersion>8</javaVersion>
<project.build.outputTimestamp>2023-04-30T22:19:57Z</project.build.outputTimestamp>
<!-- TODO check with next parent -->
<maven.plugin.tools.version>3.8.1</maven.plugin.tools.version>
<project.build.outputTimestamp>2024-05-12T20:32:57Z</project.build.outputTimestamp>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-bom</artifactId>
<version>3.25.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.5</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.13.0</version>
<version>9.7</version>
</dependency>

<!-- testing support -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -157,13 +154,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<!-- TODO check with next parent -->
<version>3.5.1</version>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<localRepositoryPath>target/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<postBuildHookScript>verify</postBuildHookScript>
<preBuildHookScript>setup</preBuildHookScript>
<goals>
<goal>verify</goal>
</goals>
Expand Down
64 changes: 64 additions & 0 deletions src/it/excludeClassFromJar/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?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.shared.dependency-analyzer.tests</groupId>
<artifactId>jarWithXercesDependencies</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.shared.dependency-analyzer.tests</groupId>
<artifactId>maven-mock-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<goals>
<goal>mock-analyze</goal>
</goals>
</execution>
</executions>
<configuration>
<excludedClasses>
<exclude>org.xml.sax.*</exclude>
</excludedClasses>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package jarWithXmlTransitiveDependency;

/*
* 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.
*/

import org.dom4j.Text;
import org.xml.sax.Parser;

/**
* Dependency on dom4j gives xml-apis transitive dependency, which contains SAX Parser class. But SAX Parser is available in
* JDK: no need to declare a direct dependency.
*
*/
public class Project
{
public Text text;

public Parser parser;

// constructors -----------------------------------------------------------

public Project()
{
// no op
}
}
33 changes: 33 additions & 0 deletions src/it/excludeClassFromJar/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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 analysis = new File( basedir, 'target/analysis.txt' ).text

def expected = '''
UsedDeclaredArtifacts:
dom4j:dom4j:jar:1.6.1:compile
UsedUndeclaredArtifactsWithClasses:
UnusedDeclaredArtifacts:
TestArtifactsWithNonTestScope:
'''

assert analysis == expected
56 changes: 56 additions & 0 deletions src/it/excludeClassFromProject/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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.shared.dependency-analyzer.tests</groupId>
<artifactId>jarWithXercesDependencies</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.shared.dependency-analyzer.tests</groupId>
<artifactId>maven-mock-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<goals>
<goal>mock-analyze</goal>
</goals>
</execution>
</executions>
<configuration>
<excludedClasses>
<exclude>org.example.BadClass</exclude>
</excludedClasses>
</configuration>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit 91136d9

Please sign in to comment.