flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric THOMAS <webdoubl...@hotmail.com>
Subject RE: AW: [FlexMojos] Compatible Model Validator
Date Tue, 09 Dec 2014 09:33:49 GMT
last night I started a POC adding a goal to the maven-dependency-plugin and extending some
of the Maven internal classes to try to address that thru this plugin, my time is limited
and still have to implement the integration tests but in case it works with this plugin, I
thing it could with FM, let's see...

Frédéric THOMAS

> From: christofer.dutz@c-ware.de
> To: users@flex.apache.org
> Subject: AW: [FlexMojos] Compatible Model Validator
> Date: Tue, 9 Dec 2014 09:24:14 +0000
> 
> Well in order to address this issue I was planning on automatically processing the dependencies
in a flex project and to have flexmojos add direct rsl scoped deps for transitive dependencies.
Should make the copy rsl goal work correctly.
> 
> Unfortunately my motivation investing my time in flex is currently at an all time low.
Perhaps I'll look into this during the Christmas holidays.
> 
> Chris
> 
> Gesendet mit meinem HTC
> 
> ----- Reply message -----
> Von: "Frédéric THOMAS" <webdoublefx@hotmail.com>
> An: "users@flex.apache.org" <users@flex.apache.org>
> Betreff: [FlexMojos] Compatible Model Validator
> Datum: Mo., Dez. 8, 2014 16:27
> 
> > Unfortunately you will only prevent the warning messages. Still maven won't dresolve
the scopes correctly when it comes to transitive dependencies :-( rely shooting would make
it necessary do do greater changes in mavens inner workings. But it's still a lot better than
to have the errors all the time.
> You're right, in more because my "builder" parent pom have their own lifecycles, I can't
rely on the copy-flex-resources goal to copy RSLs as it doesn't resolve (because it can't)
the RSLs but check directly in the poms, which is very bad when you have parameterized  the
merge, caching, rsl scopes, it finds only variables, thus, I wrote a groovy script which look
at the *-configs:xml dependencies and extract the rsls info from the them and copy them to
the "rsls" dir defined by the user, it seems a lot of work but it is not, moreover, at compile
time, I ask FM to generate a classifier for each environment I need to deploy to but here
again FM doesn't know how to manage custom classifiers and link-report, configs and size-report,
so, all in I had to rely on something else, this little groovy script for those interested
and the Maven conf after:
> import groovy.util.XmlSlurper
> 
> import java.nio.file.Files;
> 
> def destinationDirectory = new File(project.properties.rslDestination)
> 
> if (!destinationDirectory.exists())
>     destinationDirectory.mkdir()
> 
> project.dependencies.findAll{artifact -> artifact.getClassifier()== project.properties.configClassifier
&& artifact.getType()=='xml'}.each() {
>     def artifact = it;
>     println "Copying Flex resources for: " + artifact
> 
>     def configFile = new File(settings.localRepository + File.separator +
>             artifact.groupId.replace(".", File.separator) + File.separator +
>             artifact.artifactId + File.separator +
>             artifact.version + File.separator +
>             artifact.artifactId + "-" + artifact.version + "-" + project.properties.configClassifier
+ "." + artifact.type)
> 
>     def root = new XmlSlurper().parse(configFile)
> 
>     def rslPathNodes = root["runtime-shared-library-path"];
> 
>     rslPathNodes.each() {
>         def rslPath = it["path-element"]
>         def rslUrl = it["rsl-url"][0]
> 
>         def rslUrlString =  rslUrl.toString()
>         def ext = rslUrlString.substring(rslUrlString.lastIndexOf("."));
> 
>         def originRslFile = new File(rslPath.toString().replace(".swc", ext));
>         def destinationRslFile = new File(project.properties.rslDestination + File.separator
+ originRslFile.getName())
> 
>         if (!destinationRslFile.exists()) {
>             println "Copying RSL : " + originRslFile.getAbsolutePath() + "to : " + destinationRslFile.getAbsolutePath()
>             Files.copy(originRslFile.toPath(), destinationRslFile.toPath())
>         } else println "Skiping RSL copy of : " + destinationRslFile.getAbsolutePath()
+ " [Already exist]"
>     }
> }
>     <plugin>
>         <groupId>org.codehaus.gmaven</groupId>
>         <artifactId>gmaven-plugin</artifactId>
> 
>         <executions>
>             <execution>
>                 <id>copy-flex-resources</id>
>                 <phase>generate-resources</phase>
>                 <goals>
>                     <goal>execute</goal>
>                 </goals>
>                 <configuration>
>                     <properties>
>                         <rslDestination>${project.build.outputDirectory}/rsls</rslDestination>
>                         <configClassifier>${build.profile.id}-configs</configClassifier>
>                     </properties>
>                     <classpath>
>                         <element>
>                             <groupId>org.codehaus.groovy</groupId>
>                             <artifactId>groovy-xml</artifactId>
>                             <version>2.1.0-rc-2</version>
>                         </element>
>                     </classpath>
>                     <source>${pom.basedir}/src/main/script/copyFlexResources.groovy</source>
>                 </configuration>
>             </execution>
>         </executions>
>     </plugin>
> 
> <dependencies>
>     <dependency>
>         <groupId>com.*.blabla</groupId>
>         <artifactId>Application</artifactId>
>         <version>${Application-version}</version>        <classifier>${build.profile.id}-configs</classifier>
>         <type>xml</type>
>     </dependency>
> 
>     <dependency>
>         <groupId>com.*blabla</groupId>        <artifactId>Module</artifactId>
>         <version>${Module-version}</version><classifier>${build.profile.id}-configs</classifier>
       <type>xml</type>
>     </dependency>
> </dependencies>
> 
> Frédéric THOMAS
> 
> > From: christofer.dutz@c-ware.de
> > To: users@flex.apache.org
> > Subject: AW: [FlexMojos] Compatible Model Validator
> > Date: Sat, 6 Dec 2014 21:52:00 +0000
> >
> > Unfortunately you will only prevent the warning messages. Still maven won't dresolve
the scopes correctly when it comes to transitive dependencies :-( rely shooting would make
it necessary do do greater changes in mavens inner workings. But it's still a lot better than
to have the errors all the time.
> >
> > Chris
> >
> > Gesendet mit meinem HTC
> >
> > ----- Reply message -----
> > Von: "Frédéric THOMAS" <webdoublefx@hotmail.com>
> > An: "users@flex.apache.org" <users@flex.apache.org>
> > Betreff: [FlexMojos] Compatible Model Validator
> > Datum: Sa., Dez. 6, 2014 15:54
> >
> > Hi Chris,
> >
> > Allowing more Maven Scopes is the reason why the extension I created should be install
before the build, for other kind of validations, you can still create your extension but no
needs to install it before the build, AFAIK you can simply add it inside the build.extensions
of your project  parent pom if the extension is an AbstractMavenLifeCycleParticipant and override
the public void afterProjectsRead( MavenSession session ) and I guess from here, with the
help of the MavenSession [1], you can have access to anything you need to do other kind of
validations or even other things.
> >
> > Or I didn't get well your point :-)
> >
> > Frédéric THOMAS
> >
> > [1] http://maven.apache.org/ref/3.2.3/maven-core/apidocs/org/apache/maven/execution/MavenSession.html
> >
> > > From: christofer.dutz@c-ware.de
> > > To: users@flex.apache.org
> > > Subject: AW: [FlexMojos] Compatible Model Validator
> > > Date: Fri, 5 Dec 2014 19:16:59 +0000
> > >
> > > Well I was thinking of a logic integrated into maven that allows plugins to
contribute validators that he'll validating their own configuration. Unfortunately this is
only possible using a maven extension (actually exactly the extension point you used). I am
and was getting a lot of support questions which would actually be easy to validate automatically
but are hard to guide humans through ;-)
> > >
> > > Let's say the logic would go through the plugins in the build and check each
jar for validator logic an use this it found and have them validate their own configuration.
> > >
> > > Hope this explains what I was thinking of.
> > >
> > > Chris
> > >
> > > Gesendet mit meinem HTC
> > >
> > > ----- Reply message -----
> > > Von: "Frédéric THOMAS" <webdoublefx@hotmail.com>
> > > An: "users@flex.apache.org" <users@flex.apache.org>
> > > Betreff: [FlexMojos] Compatible Model Validator
> > > Datum: Fr., Dez. 5, 2014 18:33
> > >
> > > Hum.. Not sure I understand totally, you want to add an extension to FlexMojos
as a module and that extension could be extended to add features like rules and suggestions
regarding the plugin configuration ?
> > >
> > > Frédéric THOMAS
> > >
> > > > From: christofer.dutz@c-ware.de
> > > > To: users@flex.apache.org
> > > > Subject: AW: [FlexMojos] Compatible Model Validator
> > > > Date: Fri, 5 Dec 2014 16:27:54 +0000
> > > >
> > > > Eventually a modular solution would be a good idea. One that can be extended
with rules and suggestions regarding the plugin configuration. If for example someone uses
deprecated config options or invalid ones, if someone uses bad practices etc.
> > > >
> > > > Chris
> > > >
> > > > Gesendet mit meinem HTC
> > > >
> > > > ----- Reply message -----
> > > > Von: "Frédéric THOMAS" <webdoublefx@hotmail.com>
> > > > An: "users@flex.apache.org" <users@flex.apache.org>
> > > > Betreff: [FlexMojos] Compatible Model Validator
> > > > Datum: Fr., Dez. 5, 2014 16:03
> > > >
> > > > I mean, adding the extension as a new module and add a goal to install
the extension, what do you think ?
> > > >
> > > > Frédéric THOMAS
> > > >
> > > > From: webdoublefx@hotmail.com
> > > > To: users@flex.apache.org
> > > > Subject: RE: AW: [FlexMojos] Compatible Model Validator
> > > > Date: Fri, 5 Dec 2014 15:01:06 +0000
> > > >
> > > >
> > > >
> > > >
> > > > Could be a new goal ?
> > > >
> > > > Frédéric THOMAS
> > > >
> > > > > From: christofer.dutz@c-ware.de
> > > > > To: users@flex.apache.org
> > > > > Subject: AW: [FlexMojos] Compatible Model Validator
> > > > > Date: Fri, 5 Dec 2014 14:54:37 +0000
> > > > >
> > > > > Well I was more thinking of adding a module to flexmojos in order
to release the lib. Copying would have to remain a manual task as I don't want to modify the
maven installation.
> > > > >
> > > > > Chris
> > > > >
> > > > > Gesendet mit meinem HTC
> > > > >
> > > > > ----- Reply message -----
> > > > > Von: "Frédéric THOMAS" <webdoublefx@hotmail.com>
> > > > > An: "users@flex.apache.org" <users@flex.apache.org>
> > > > > Betreff: [FlexMojos] Compatible Model Validator
> > > > > Datum: Fr., Dez. 5, 2014 13:50
> > > > >
> > > > > Hi Chris,
> > > > > > I assume this is a maven extension which you have to deploy
to your maven extension directory
> > > > > yes it is even though, I provided a profile to auto install it [1]
> > > > > > I remember discussing something like this with cello a few years
ago but he deleted my posts on this topic and refused to add that to flexmojos.
> > > > > It happened to me as well and he even kicked me out of the group,
bloody Velo :-)
> > > > > > Nave now there's a way to add that as an additional module?
But only if you're interested in this.
> > > > > Well I wouldn't how to do except that the plugin could copy the deployed
extension into the lib/ext folder as done in Wagon maven plugin [2]
> > > > > Any better ideas?
> > > > >
> > > > > Frédéric THOMAS
> > > > > [1]<profile>
> > > > >     <id>prepare-maven-extended-libs</id>
> > > > >     <activation>
> > > > >         <file>
> > > > >             <missing>${env.MAVEN_HOME}/lib/ext/flexmojos-compatible-model-validator.jar</missing>
> > > > >         </file>
> > > > >     </activation>
> > > > >     <build>
> > > > >         <plugins>
> > > > >             <plugin>
> > > > >                 <groupId>org.apache.maven.plugins</groupId>
> > > > >                 <artifactId>maven-dependency-plugin</artifactId>
> > > > >                 <version>2.8</version>
> > > > >                 <executions>
> > > > >                     <execution>
> > > > >                         <id>copy</id>
> > > > >                         <phase>validate</phase>
> > > > >                         <goals>
> > > > >                             <goal>copy</goal>
> > > > >                         </goals>
> > > > >                         <configuration>
> > > > >                             <artifactItems>
> > > > >                                 <artifactItem>
> > > > >                                     <groupId>com.doublefx.maven.utils.flexmojos</groupId>
> > > > >                                     <artifactId>flexmojos-compatible-model-validator</artifactId>
> > > > >                                     <version>1.0.0-SNAPSHOT</version>
> > > > >                                     <type>jar</type>
> > > > >                                     <overWrite>true</overWrite>
> > > > >                                     <outputDirectory>${env.MAVEN_HOME}/lib/ext</outputDirectory>
> > > > >                                     <destFileName>flexmojos-compatible-model-validator.jar</destFileName>
> > > > >                                 </artifactItem>
> > > > >                             </artifactItems>
> > > > >                             <overWriteReleases>true</overWriteReleases>
> > > > >                             <overWriteSnapshots>true</overWriteSnapshots>
> > > > >                         </configuration>
> > > > >                     </execution>
> > > > >                 </executions>
> > > > >             </plugin>
> > > > >             <plugin>
> > > > >                 <groupId>org.codehaus.gmaven</groupId>
> > > > >                 <artifactId>gmaven-plugin</artifactId>
> > > > >                 <version>1.4</version>
> > > > >                 <executions>
> > > > >                     <execution>
> > > > >                         <phase>validate</phase>
> > > > >                         <goals>
> > > > >                             <goal>execute</goal>
> > > > >                         </goals>
> > > > >                     </execution>
> > > > >                 </executions>
> > > > >                 <configuration>
> > > > >                     <source>
> > > > >                         fail("FlexMojos Compatible Model Validator
extension is now configured. Please restart the build, and then it will be successful.")
> > > > >                     </source>
> > > > >                 </configuration>
> > > > >             </plugin>
> > > > >         </plugins>
> > > > >     </build>
> > > > > </profile>
> > > > >
> > > > > [2] http://svn.codehaus.org/mojo/tags/wagon-maven-plugin-1.0-beta-5/src/main/java/org/codehaus/mojo/wagon/UpdateMaven3Mojo.java
> > > > > > From: christofer.dutz@c-ware.de
> > > > > > To: users@flex.apache.org
> > > > > > Subject: AW: [FlexMojos] Compatible Model Validator
> > > > > > Date: Fri, 5 Dec 2014 11:51:34 +0000
> > > > > >
> > > > > > Cool Stuff.
> > > > > >
> > > > > > Will definitely look into this. But I assume this is a maven
extension which you have to deploy to your maven extension directory, our was there a maven
change that allows this as a plugin?
> > > > > >
> > > > > > I remember discussing something like this with cello a few years
ago but he deleted my posts on this topic and refused to add that to flexmojos.
> > > > > >
> > > > > > Nave now there's a way to add that as an additional module?
But only if you're interested in this.
> > > > > >
> > > > > > Chris
> > > > > >
> > > > > > Gesendet mit meinem HTC
> > > > > >
> > > > > > ----- Reply message -----
> > > > > > Von: "Frédéric THOMAS" <webdoublefx@hotmail.com>
> > > > > > An: "users@flex.apache.org" <users@flex.apache.org>
> > > > > > Betreff: [FlexMojos] Compatible Model Validator
> > > > > > Datum: Fr., Dez. 5, 2014 12:41
> > > > > >
> > > > > > Hi,
> > > > > > For those interested I created and shared a Maven extension
to get rid of the Maven warnings regarding the custom scopes [1].
> > > > > > Frédéric THOMAS
> > > > > > [1] https://github.com/doublefx/flexmojos-compatible-model-validator
> > > > >
> > > >
> > >
> >
> 
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message