private synchronized void internalCreateAndDeployKjarToMaven ( ReleaseId releaseId , String kbaseName , String ksessionName , List < String > resourceFilePaths , List < Class < ? > > classes , List < String > dependencies ) { InternalKieModule kjar = ( InternalKieModule ) internalCreateKieJar ( releaseId , kbaseName , ksessionName , resourceFilePaths , classes , dependencies ) ; String pomFileName = MavenRepository . toFileName ( releaseId , null ) + ".pom" ; File pomFile = new File ( System . getProperty ( "java.io.tmpdir" ) , pomFileName ) ; try { FileOutputStream fos = new FileOutputStream ( pomFile ) ; fos . write ( config . pomText . getBytes ( IoUtils . UTF8_CHARSET ) ) ; fos . flush ( ) ; fos . close ( ) ; } catch ( IOException ioe ) { throw new RuntimeException ( "Unable to write pom.xml to temporary file : " + ioe . getMessage ( ) , ioe ) ; } KieMavenRepository repository = getKieMavenRepository ( ) ; repository . installArtifact ( releaseId , kjar , pomFile ) ; }
Create a KJar and deploy it to maven .