I am using php and I am one of the developers of php-maven.org. As this is the only php to maven project I found I don't think someone solved it (for php). The source folders should be src/main/php and src/test/php. Packaging is "php" introduced by our maven extension. The only php extension I found is using packaging "pom" and introduces some ant scripts. That's not what I want since I could use ant directly.... So I decided to support the php-maven community as developer.
The other languages I tried to search for either use the corresponding entries in the pom.xml or they need to declare the source folder in a parent pom. I do understand if this is the recommended way. And we will recommend it if this is the only way you can manipulate the source folders. But maybe there is another way we could use so that the users of php-maven do not need to specifiy the source folders in their poms. IMHO the packaging "pom" should be enough for maven to load some defaults on the project. Maybe you know another language that introduces their source folders without need of inherit a parent pom or without the need to manually specify it in the projects pom? I did not find any. Currently we are introducing a small goal: https://github.com/php-maven/maven-php-plugin/blob/maven3/src/main/java/org/phpmaven/plugin/build/SetSources.java It is executed very early and hopefully it will be executed for every common phase: https://github.com/php-maven/maven-php-plugin/blob/maven3/src/main/resources/META-INF/plexus/components.xml[https://github.com/php-maven/maven-php-plugin/blob/maven3/src/main/resources/META-INF/plexus/components.xml] However it works but feels some kind of "bad hacking". -----UrsprĂĽngliche Nachricht----- Von: "Ron Wheeler" <[email protected]> Gesendet: 08.11.2011 15:42:40 An: [email protected] Betreff: Re: How to set src-folder correctly "not using java" is not too much help. What language are you using? What are you trying to build. Perhaps you will find that your problem is already solved for your language of choice. It is always better to state you problem in the context of what you are trying to do. We waste lots of time in this forum and delay the resolution of problems because the original problem is stated very narrowly and the solution is very simple but at a higher level. If you explain what you are trying to build, you might get a better answer - plug-in for that language, assembly plug-in to build an archive file from pre-compiled code and configuration files. If you are doing it, chances are many others are already using Maven to build it. Ron On 08/11/2011 5:20 AM, Martin Eisengardt wrote: > Hi. > > I was adviced to send this to the users mailing list and not the dev mailing > lists. However I got an answer. > > --- original question --- > > We are using maven for own project types. However the source folders > (src/main/java and src/test/java) are not the same since we are not using > java. To let some plugins work correctly we need to ovrwrite them with the > correct folders. > > For know we created a small goal that will be executed early. It will > overwrite the source folders directly. It works but I don't feel it is the > correct way. Do you recommend another way, for example some hint in > components.xml I did not see yet? How do we tell maven that the source > folders for our own packaging are not the java ones? > > If having an early goal setting the source folders programtically, what goal > should we choose? The "validate" goal is the first one and so the best one to > set the new source folders but it is focused of "validation" of the project > and not focused on "hack project pom to fit the best needs". > > --- answer from wayne fay --- > > What you are requesting is trivially accomplished via various entries in > your pom.xml files. This is documented on the Maven website. Ideally you > would have a single top parent pom that all your projects inherit from, and > set the proper values there (in the top parent). > > --- my remarks --- > > I hoped that we do not need all of the plugin users to rely on a parent-pom > we are serving. In other word: I hoped to find a way other than using the > pom.xml in every project. Is there no way saying "packaging xxx uses > different source folders", f.e. in components.xml? All I am seeing is that > maven hard-coded the java related super pom as a mixin. But the super pom > should be customized or another mixin should be automatically added in our > use case. > The uses of our plugin already have to add it to the build plugin lists to > activate the packaging. But thats really fair and ok. > > Of course redeclaring in pom will work. > > > Greetings > Martin > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Ron Wheeler President Artifact Software Inc email: [email protected] skype: ronaldmwheeler phone: 866-970-2435, ext 102 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
