Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers
  2. SHRINKRES-149

Maven classpathworkspace resolver shouldn't assume classes are under target/classes

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.0.0
    • None
    • None

      To avoid conflicting builds between Maven and Eclipse, I put eclipse build into a "eclipse-build/classes" directory.
      Considering this configuration, with the following code :

       Maven.resolver()
      				.offline()
      				.loadPomFromFile("../../pom.xml")
      				.resolve("com.linagora.obm:services-module:2.6.0-SNAPSHOT")
      				.withClassPathResolution(true)
      				.withTransitivity()
      				.asFile();
      

      Maven resolver find my services-module on the classpath, but when trying a build a jar, it fails in MavenResolvedArtifactImpl.artifactToFile :

       // SHRINKRES-102, allow test classes to be packaged as well
                  File root = new File(artifact.getFile().getParentFile(), "target/classes");
      

      In my case, target/classes contains maven build result and not what's on the classpath.

      Can this resolver use the classes on the classpath instead ?

            Unassigned Unassigned
            m_baechler Matthieu Baechler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: