Hello Hauke, I have received your message three times now. I have not responded, hoping someone else would have something constructive for you, but failing that, you can have my take on it.
I think the structure you are trying to enforce is weird, and while I applaud Maven for letting you do it, I would not want to work in a place that wanted to make archetypes to template this on all projects. If this is the 'Eclipse structure', gross. Asking to omit the pom.xml is even weirder. I was unfamiliar with this Eclipse Tycho pomless concept, and if it's working for them, fine. Omitting the pom.xml to support it doesn't sound like useful work for Maven developers. Maybe your archetype can contain an ant task to delete the pom.xml and empty directories you want to remove. Greg Chabala On Fri, Jul 15, 2022 at 12:53 AM Fuhrmann, Hauke < fuhrmann.ha...@scheidt-bachmann-st.de> wrote: > Hi there, > > my company is building Java projects with a customised folder structure > not directly following the Maven standard directory structure > ("src/main/java" and "src/test/java") but the Eclipse Java structure ("src" > and "src-test"). > > I try to create an archetype for our own projects following the archetype > packaging: https://maven.apache.org/archetype/archetype-packaging/ > > It works all fine except that maven always adds some main/java and > test/java folders into my source folders. > > My archetype ressources are > > archetype-resources/ > ├─ META-INF/ > │ ├─ MANIFEST.MF > ├─ OSGI-INF/ > ├─ src/ > │ ├─ Demo.java > ├─ src-test/ > │ ├─ DemoTest.java > ├─ .classpath > ├─ .project > ├─ build.properties > ├─ pom.xml > > The archetype.metadata has this filesSets > > <fileSets> > <fileSet filtered="true" packaged="true"> > <directory>src</directory> > </fileSet> > <fileSet filtered="true" packaged="true"> > <directory>src-test</directory> > </fileSet> > <fileSet filtered="true"> <!-- main ressources such as > about.html --> > <includes> > <include>*</include> <!-- take everything on first > hierarchy level --> > </includes> > <directory></directory> > </fileSet> > </fileSets> > > The resulting directory structure is: > > archetype-resources/ > ├─ META-INF/ > │ ├─ MANIFEST.MF > ├─ OSGI-INF/ > ├─ src/ > │ ├─ mypackage/ > │ │ ├─ Demo.java > │ ├─ main/ > │ │ ├─ java/ > │ ├─ test/ > │ │ ├─ java/ > ├─ src-test/ > │ ├─ mypackage/ > │ │ ├─ DemoTest.java > ├─ .classpath > ├─ .project > ├─ build.properties > ├─ pom.xml > So it's all fine except these empty main/java and test/java folders in the > src folder. Any way how to change this? > In plain maven I could add the sourceDirectory and unittestSourceDirectory > to the build-section. But this cannot be set in the archetype.metadata file. > > Is there any way how to omit the pom.xml in the target project? Eclipse > typcho maven plugin allows a pomless-build that does not require poms in > the single projects. > > Cheers, > Hauke > > > > Please see our data privacy policy: > https://www.scheidt-bachmann.de/en/data-privacy/ > Important Notice: This E-Mail and any files attached are confidential and > may contain privileged information. > If you are not the intended recipient, do not forward or disclose this > E-Mail, open any attachments, make any copies or save this E-Mail anywhere. > Please delete this E-Mail from your system and notify the sender (as > applicable also by phone +49 2166 266-0). Thank you very much. > > To send this email we must process the following personal data: Your email > address, first name and surname. > Your data is processed solely for the purpose of sending this email and > passed on to third parties only for this purpose. > You have been included in the circle of recipients for our emails due to > your professional, social or political position. If this position changes, > or you inform us that you do not want to receive emails from us, or you > object to the further processing of your data, we will delete your data and > no longer use it.