PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, May 19, 2022

[FIXED] How to add source files generated in target folder as library in Intellij Idea

 May 19, 2022     intellij-idea, maven, proxy-classes, web-services     No comments   

Issue

I'm trying to checkout a maven project from SubVersion. In the pom.xml file it's specified to generate web service proxy classes in the target folder. Here's the concerned part of the pom.xml file:

          <execution>
                <goals>
                    <goal>wsimport</goal>
                </goals>
                <configuration>

                    <wsdlUrls>                               
                        <wsdlUrl>${basedir}/config/mnpBusinessService.wsdl</wsdlUrl>
                    </wsdlUrls>

                    <packageName>com.mnp.services.business</packageName>
                    <sourceDestDir>${basedir}/target/generated-code/src</sourceDestDir>
                </configuration>
                <id>ws-import-mnpBusinessService</id>
                <phase>generate-sources</phase>
           </execution>

As you can see the maven is instructed to create the generated proxy classes in the ${basedir}/target/generated-code/src directory. When I checkout with NetBeans, a seperate GeneratedCode directory is created as part of the project. And any package inside this directory is available to the main source files. But when I checkout with Intellij Idea,

  1. I have to manually execute install command and second.

  2. The files are indeed created in the specified directory but main source files can't see those packages.

I've tried Project Structure|Modules|MyModule|Dependencies|Add Jars or directories and Project Structure|Libraries|Add|Java|Mydiectoryy. But neither helped. I also tried removing the target folder from Exclude list but that didn't help either. What should I do to be able to import generated proxy classes in Intellij Idea. It's the Ultimate version 2016.2.4.


Solution

I ended up creating a module from existing sources, where existing sources folder is my generated-code folder. Then from the Modules|My main module|Dependencies|Add module and chose the just created module. And voila.

Here are the steps I followed:

1.

enter image description here

2.

enter image description here

3

enter image description here

4

enter image description here



Answered By - Mikayil Abdullayev
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing