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

Cycle dependency among packages #32

Open
sadovnikov opened this issue Oct 13, 2017 · 2 comments
Open

Cycle dependency among packages #32

sadovnikov opened this issue Oct 13, 2017 · 2 comments

Comments

@sadovnikov
Copy link

Adding NoPackageCyclesEnforcerRule to maven-enforcer-plugin highlights presence of a cycle dependency among the packages.
This disables applying the same enforcer rule to, for example, projects of IDE or build server plugins, where classes of "compile" dependencies, including plexus-utils, get baked into the build artifact

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.1.1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>no-package-cycles-enforcer-rule</artifactId>
            <version>1.2.20</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>enforce-no-package-cycles</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <rules>
                <NoPackageCyclesRule implementation="org.apache.axiom.buildutils.enforcer.NoPackageCyclesEnforcerRule"/>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
[WARNING] Rule 0: org.apache.axiom.buildutils.enforcer.NoPackageCyclesEnforcerRule failed with message:
Package cycle detected. Classes involved:
  org.codehaus.plexus.util.xml.pull.MXParser -> org.codehaus.plexus.util.ReaderFactory
  org.codehaus.plexus.util.xml.pull.MXParser -> org.codehaus.plexus.util.xml.XmlStreamReader
  org.codehaus.plexus.util.xml.PrettyPrintXMLWriter -> org.codehaus.plexus.util.StringUtils
  org.codehaus.plexus.util.xml.SerializerXMLWriter -> org.codehaus.plexus.util.xml.pull.XmlSerializer
  org.codehaus.plexus.util.ReaderFactory -> org.codehaus.plexus.util.xml.XmlStreamReader
@rfscholte
Copy link
Member

I think this is an issue with the NoPackageCyclesRule. It should not verify cycles within plugins, but only on your project, at least I hope so.

@sadovnikov
Copy link
Author

sadovnikov commented Oct 16, 2017

I fully appreciate unusualness of the situation with plugins, where *.class files of their "compile" dependencies have to be placed into the plugin *.jar. NoPackageCyclesRule analyzes classes in "test" phase of the build, gets all *.class files and, unfortunately, it does provide a way to define packages to check.

I'll try to suggest PR to resolve the cycle in pluxus-util. However, even if accepted, it will take very long before new version starts being used through transitive dependencies. I have to write my own version of NoPackageCyclesRule anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants