jtulach commented on code in PR #9624:
URL: https://github.com/apache/netbeans/pull/9624#discussion_r4135855717


##########
platform/build.xml:
##########
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>

Review Comment:
   ### The AntRun Trick
   
   The trick is to:
   - convince **Maven to do nothing** during `mvn install`
   - let Maven delegate to Ant via `antrun` plugin
   - that way **Maven exposes dependencies**
   - but we continue to use the old build tools exactly as they exist now
   
   ```diff
   diff --git pom.xml pom.xml
   new file mode 100644
   index 0000000000..3ba73178cf
   --- /dev/null
   +++ pom.xml
   @@ -0,0 +1,120 @@
   +<?xml version="1.0" encoding="UTF-8"?>
   +
   +<!--
   +Licensed to the Apache Software Foundation (ASF) under one
   +or more contributor license agreements.  See the NOTICE file
   +distributed with this work for additional information
   +regarding copyright ownership.  The ASF licenses this file
   +to you under the Apache License, Version 2.0 (the
   +"License"); you may not use this file except in compliance
   +with the License.  You may obtain a copy of the License at
   +
   +  http://www.apache.org/licenses/LICENSE-2.0
   +
   +Unless required by applicable law or agreed to in writing,
   +software distributed under the License is distributed on an
   +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   +KIND, either express or implied.  See the License for the
   +specific language governing permissions and limitations
   +under the License.
   +-->
   +
   +<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   +    <modelVersion>4.0.0</modelVersion>
   +
   +    <parent>
   +        <groupId>org.apache</groupId>
   +        <artifactId>apache</artifactId>
   +        <version>35</version>
   +    </parent>
   +
   +    <groupId>org.apache.netbeans</groupId>
   +    <artifactId>netbeans-parent</artifactId>
   +    <version>RELEASE33-SNAPSHOT</version>
   +    <packaging>pom</packaging>
   +    
   +    <modules>
   +        <module>platform</module>
   +        <module>harness</module>
   +    </modules>
   +
   +    <name>Apache Netbeans</name>
   +    <description>Apache NetBeans is an integrated development environment, 
tooling platform, and application framework.</description>
   +    <url>https://netbeans.apache.org/</url>
   +    <licenses>
   +        <license>
   +            <name>The Apache Software License, Version 2.0</name>
   +            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
   +            <distribution>repo</distribution>
   +        </license>
   +    </licenses>
   +    <distributionManagement>
   +        <site>
   +            <id>netbeans.bits</id>
   +            
<url>https://bits.netbeans.org/mavenutilities/netbeans-parent</url>
   +        </site>
   +    </distributionManagement>
   +    <developers>
   +        <developer>
   +            <id>apachenetbeansdev</id>
   +            <name>Apache NetBeans Dev Mailing List</name>
   +            <email>[email protected]</email>
   +        </developer>
   +    </developers>
   +
   +    <mailingLists>
   +        <mailingList> 
   +            <name>Apache Netbeans Users List</name>
   +            <subscribe>[email protected]</subscribe>
   +            <unsubscribe>[email protected]</unsubscribe>
   +            <post>mailto:[email protected]</post>
   +            
<archive>https://mail-archives.apache.org/mod_mbox/netbeans-users/</archive>
   +        </mailingList>
   +        <mailingList> 
   +            <name>Apache Netbeans Dev List</name>
   +            <subscribe>[email protected]</subscribe>
   +            <unsubscribe>[email protected]</unsubscribe>
   +            <post>mailto:[email protected]</post>
   +            
<archive>https://mail-archives.apache.org/mod_mbox/netbeans-dev/</archive>
   +        </mailingList>
   +        <mailingList> 
   +            <name>Apache Netbeans NetCAT List</name>
   +            <subscribe>[email protected]</subscribe>
   +            
<unsubscribe>[email protected]</unsubscribe>
   +            <post>mailto:[email protected]</post>
   +            
<archive>https://mail-archives.apache.org/mod_mbox/netbeans-netcat/</archive>
   +        </mailingList>
   +        <mailingList> 
   +            <name>Apache Netbeans Announcements List</name>
   +            <subscribe>[email protected]</subscribe>
   +            
<unsubscribe>[email protected]</unsubscribe>
   +            <post>mailto:[email protected]</post>
   +            
<archive>https://mail-archives.apache.org/mod_mbox/netbeans-announce/</archive>
   +        </mailingList>
   +        <mailingList> 
   +            <name>Apache Netbeans Commits List</name>
   +            <subscribe>[email protected]</subscribe>
   +            
<unsubscribe>[email protected]</unsubscribe>
   +            <post>mailto:[email protected]</post>
   +            
<archive>https://mail-archives.apache.org/mod_mbox/netbeans-commits/</archive>
   +        </mailingList>
   +        <mailingList> 
   +            <name>Apache Netbeans Notifications List</name>
   +            
<subscribe>[email protected]</subscribe>
   +            
<unsubscribe>[email protected]</unsubscribe>
   +            <post>mailto:[email protected]</post>
   +            
<archive>https://mail-archives.apache.org/mod_mbox/netbeans-notifications/</archive>
   +        </mailingList>
   +    </mailingLists>
   +
   +    <scm>
   +        
<connection>scm:git:https://gitbox.apache.org/repos/asf/netbeans-parent.git</connection>
   +        
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/netbeans-parent.git</developerConnection>
   +        <url>https://github.com/apache/netbeans-parent</url>
   +      <tag>netbeans-parent-5</tag>
   +  </scm>
   +    <issueManagement>
   +        <system>github</system>
   +        <url>https://github.com/apache/netbeans/issues</url>
   +    </issueManagement>
   +</project>
   diff --git platform/openide.util.lookup/pom.xml 
platform/openide.util.lookup/pom.xml
   new file mode 100644
   index 0000000000..165494a16e
   --- /dev/null
   +++ platform/openide.util.lookup/pom.xml
   @@ -0,0 +1,70 @@
   +<?xml version="1.0" encoding="UTF-8"?>
   +<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   +    <modelVersion>4.0.0</modelVersion>
   +    <parent>
   +        <groupId>org.netbeans.cluster</groupId>
   +        <artifactId>platform</artifactId>
   +        <version>RELEASE33-SNAPSHOT</version>
   +    </parent>
   +    <groupId>org.netbeans.api</groupId>
   +    <artifactId>org-openide-util-lookup</artifactId>
   +    <packaging>pom</packaging> <!-- Keeps IDE source recognition active -->
   +    <dependencies>
   +        <dependency>
   +            <groupId>${project.groupId}</groupId>
   +            <artifactId>org-netbeans-modules-nbjunit</artifactId>
   +            <version>${project.version}</version>
   +        </dependency>
   +    </dependencies>
   +    <build>
   +        <sourceDirectory>src</sourceDirectory>
   +        <testSourceDirectory>test/unit/src</testSourceDirectory>
   +        <directory>build</directory>
   +        
   +        <plugins>
   +            <plugin>
   +                <groupId>org.apache.maven.plugins</groupId>
   +                <artifactId>maven-antrun-plugin</artifactId>
   +                <version>3.1.0</version>
   +                <executions>
   +                    <execution>
   +                        <id>run-ant</id>
   +                        <phase>compile</phase> <!-- Binds Ant to run where 
compilation normally happens -->
   +                        <goals>
   +                            <goal>run</goal>
   +                        </goals>
   +                        <configuration>
   +                            <target>
   +                                <ant antfile="${basedir}/build.xml"><target 
name="netbeans"/></ant>
   +                            </target>
   +                        </configuration>                    
   +                    </execution>
   +                </executions>
   +            </plugin>
   +<!-- TBD: need to find out the best way to attach the artifact.
   +            <plugin>
   +                <groupId>org.codehaus.mojo</groupId>
   +                <artifactId>build-helper-maven-plugin</artifactId>
   +                <version>3.6.0</version>
   +                <executions>
   +                    <execution>
   +                        <id>attach-ant-artifact</id>
   +                        <phase>package</phase> 
   +                        <goals>
   +                            <goal>attach-artifact</goal>
   +                        </goals>
   +                        <configuration>
   +                            <artifacts>
   +                                <artifact>
   +                                    <file>${cluster}/${module.jar}</file>
   +                                    <type>jar</type>
   +                                </artifact>
   +                            </artifacts>
   +                        </configuration>
   +                    </execution>
   +                </executions>
   +            </plugin>
   +                        -->
   +        </plugins>
   +    </build>
   +</project>
   diff --git platform/pom.xml platform/pom.xml
   new file mode 100644
   index 0000000000..4dbe9303d6
   --- /dev/null
   +++ platform/pom.xml
   @@ -0,0 +1,18 @@
   +
   +<?xml version="1.0" encoding="UTF-8"?>
   +<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   +    <modelVersion>4.0.0</modelVersion>
   +    <parent>
   +        <groupId>org.apache.netbeans</groupId>
   +        <artifactId>netbeans-parent</artifactId>
   +        <version>RELEASE33-SNAPSHOT</version>
   +    </parent>
   +    <groupId>org.netbeans.cluster</groupId>
   +    <artifactId>platform</artifactId>
   +    <packaging>pom</packaging>
   +    <modules>
   +        <module>openide.util.lookup</module>
   +    </modules>
   +    <build>
   +    </build>
   +</project>
   diff --git harness/nbjunit/pom.xml harness/nbjunit/pom.xml
   new file mode 100644
   index 0000000000..1edfc6f9f9
   --- /dev/null
   +++ harness/nbjunit/pom.xml
   @@ -0,0 +1,70 @@
   +<?xml version="1.0" encoding="UTF-8"?>
   +<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   +    <modelVersion>4.0.0</modelVersion>
   +    <parent>
   +        <groupId>org.netbeans.cluster</groupId>
   +        <artifactId>harness</artifactId>
   +        <version>RELEASE33-SNAPSHOT</version>
   +    </parent>
   +    <groupId>org.netbeans.api</groupId>
   +    <artifactId>org-netbeans-modules-nbjunit</artifactId>
   +    <packaging>pom</packaging>
   +    <dependencies>
   +        <dependency>
   +            <!-- TBD: this is an incorrect shortcut -->
   +            <groupId>junit</groupId>
   +            <artifactId>junit</artifactId>
   +            <version>4.13.2</version>
   +        </dependency>
   +    </dependencies>
   +    <build>
   +        <sourceDirectory>src</sourceDirectory>
   +        <testSourceDirectory>test/unit/src</testSourceDirectory>
   +        <directory>build</directory>
   +        <plugins>
   +            <plugin>
   +                <groupId>org.apache.maven.plugins</groupId>
   +                <artifactId>maven-antrun-plugin</artifactId>
   +                <version>3.1.0</version>
   +                <executions>
   +                    <execution>
   +                        <id>run-ant</id>
   +                        <phase>compile</phase> <!-- Binds Ant to run where 
compilation normally happens -->
   +                        <goals>
   +                            <goal>run</goal>
   +                        </goals>
   +                        <configuration>
   +                            <exportAntProperties>true</exportAntProperties>
   +                            <target>
   +                                <ant antfile="${basedir}/build.xml"><target 
name="netbeans"/></ant>
   +                            </target>
   +                        </configuration>                
   +                    </execution>
   +                </executions>
   +            </plugin>
   +<!-- TBD: need to find out the best way to attach the artifact. -->
   +            <plugin>
   +                <groupId>org.codehaus.mojo</groupId>
   +                <artifactId>build-helper-maven-plugin</artifactId>
   +                <version>3.6.0</version>
   +                <executions>
   +                    <execution>
   +                        <id>attach-ant-artifact</id>
   +                        <phase>package</phase> 
   +                        <goals>
   +                            <goal>attach-artifact</goal>
   +                        </goals>
   +                        <configuration>
   +                            <artifacts>
   +                                <artifact>
   +                                    
<file>../../nbbuild/netbeans/harness/modules/org-netbeans-modules-nbjunit.jar</file>
   +                                    <type>jar</type>
   +                                </artifact>
   +                            </artifacts>
   +                        </configuration>
   +                    </execution>
   +                </executions>
   +            </plugin>
   +        </plugins>
   +    </build>
   +</project>
   diff --git harness/pom.xml harness/pom.xml
   new file mode 100644
   index 0000000000..6c24687802
   --- /dev/null
   +++ harness/pom.xml
   @@ -0,0 +1,18 @@
   +
   +<?xml version="1.0" encoding="UTF-8"?>
   +<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   +    <modelVersion>4.0.0</modelVersion>
   +    <parent>
   +        <groupId>org.apache.netbeans</groupId>
   +        <artifactId>netbeans-parent</artifactId>
   +        <version>RELEASE33-SNAPSHOT</version>
   +    </parent>
   +    <groupId>org.netbeans.cluster</groupId>
   +    <artifactId>harness</artifactId>
   +    <packaging>pom</packaging>
   +    <modules>
   +        <module>nbjunit</module>
   +    </modules>
   +    <build>
   +    </build>
   +</project>
   ```
   
   - this is a proof of concept:
   - defines Lookup and NbJUnit projects in Maven
   - the Lookup sources and Test sources are green
      - as the dependencies are properly specified
   - NbJUnit sources are also green
       - but not test sources as they reference Lookup
       - and cyclic dependencies aren't supported
       - but that doesn't matter as **Maven isn't the build tool** anyway
   - here is how the PoC looks in NetBeans **without apisupport** cluster 
(intentionally removed):
   
   <img width="2038" height="1293" alt="NetBeans without API Support" 
src="https://github.com/user-attachments/assets/cf47e713-ec3f-4bf0-aa25-cd0bf4e5db22";
 />



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to