Uploaded image for project: 'NPanday'
  1. NPanday
  2. NPANDAY-398

[regression introduced by 186] MojoGenerator can't generate .NET-Mojos referencing a newer NPanday.Plugin.dll

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4-incubating
    • 1.4-incubating
    • Maven Plugins
    • None

    Description

      When building NPanday against a released version (e.g. trunk -> 1.3-incubating), there is a problem generating Mojos.

      The .NET-based Plugins we release should reference NPanday.Plugin.dll from the reactor using ${project.version} - in the current case 1.3.1-incubating-SNAPSHOT. But then the MojoGenerator is used from the bootstrap-version (1.3-incubating). This one also references (is compiled against) NPanday.Plugin of 1.3-incubating.

      Now, since NPanday.Plugin is strong-named the "old" MojoGenerator reflects on the "new" .NET-based Mojos and runs into a version conflict.

      In order to fix this, we have to relax the versioning in MojoGenerator by listening to AppDomain.AssemblyResolve event and help finding the right version.

      I'm not sure if we can "downgrade" the version for the Plugin reference, or if we need to load the newer NPanday.Plugin into the AppDomain and use that instead.

      NPanday: Start Process = 12.04.2011 09:38:38
      "targetAssemblyFile=C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Addin\target\NPanday.Plugin.Addin.dll" "outputDirectory=C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Addin" "groupId=npanday.plugin" "artifactId=NPanday.Plugin.Addin" "artifactVersion=1.3.1-incubating-SNAPSHOT" "startProcessAssembly=C:\Workbench\NPanday\svn-trunk\target\NPanday.Plugin.MojoGenerator.exe" "pluginArtifactPath=C:\Workbench\NPanday\svn-trunk\target\NPanday.Plugin.dll"
      Creating Plugin Domain Manager
      Loading Generator: C:\Workbench\NPanday\svn-trunk\plugins\netplugins\NPanday.Plugin.Addin\target
      Creating Plugin Domain Manager
      Assembly :mscorlib
      Assembly :NPanday.Plugin
      Assembly :NPanday.Plugin.Addin
      [INFO]
      [INFO] Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'NPanday.Plugin.FieldAttribute' to type 'NPanday.Plugin.FieldAttribute'.
      [INFO]    at NPanday.Plugin.Generator.JavaClassUnmarshaller.convert(Type abstractMojoType, String groupId)
      [INFO]    at NPanday.Plugin.Generator.JavaClassUnmarshaller.GetMojosFor(String assemblyName, String groupId)
      [INFO]    at NPanday.Plugin.Generator.JavaClassUnmarshaller.GetMojosFor(String assemblyName, String groupId)
      [INFO]    at NPanday.Plugin.MojoGenerator.Generator.BuildPluginProject(AppDomain applicationDomain, FileInfo pluginArtifact, FileInfo outputDirectory, String groupId, String artifactId, String version)
      [INFO]    at NPanday.Plugin.MojoGenerator.Generator.Main(String[] args)
      NPanday: End Process = 12.04.2011 09:38:57; exit code = -532459699
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      

      Attachments

        Issue Links

          Activity

            People

              lcorneliussen Lars Corneliussen
              lcorneliussen Lars Corneliussen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: